target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testSavesFilesOnRequest() throws Exception { Stoppable stop = new StoppableImplementation(); Configuration conf = UTIL.getConfiguration(); Path testDir = UTIL.getDataTestDir(); FileSystem fs = UTIL.getTestFileSystem(); String confKey = "hbase.test.cleaner.delegates"; conf.set(confKey, NeverDelete.clas...
@Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
@Test public void testDeletesEmptyDirectories() throws Exception { Stoppable stop = new StoppableImplementation(); Configuration conf = UTIL.getConfiguration(); Path testDir = UTIL.getDataTestDir(); FileSystem fs = UTIL.getTestFileSystem(); String confKey = "hbase.test.cleaner.delegates"; conf.set(confKey, AlwaysDelete...
@Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
@Test public void testDoesNotCheckDirectories() throws Exception { Stoppable stop = new StoppableImplementation(); Configuration conf = UTIL.getConfiguration(); Path testDir = UTIL.getDataTestDir(); FileSystem fs = UTIL.getTestFileSystem(); String confKey = "hbase.test.cleaner.delegates"; conf.set(confKey, AlwaysDelete...
@Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
@Test public void testStoppedCleanerDoesNotDeleteFiles() throws Exception { Stoppable stop = new StoppableImplementation(); Configuration conf = UTIL.getConfiguration(); Path testDir = UTIL.getDataTestDir(); FileSystem fs = UTIL.getTestFileSystem(); String confKey = "hbase.test.cleaner.delegates"; conf.set(confKey, Alw...
@Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
@Test public void testCleanerDoesNotDeleteDirectoryWithLateAddedFiles() throws IOException { Stoppable stop = new StoppableImplementation(); Configuration conf = UTIL.getConfiguration(); final Path testDir = UTIL.getDataTestDir(); final FileSystem fs = UTIL.getTestFileSystem(); String confKey = "hbase.test.cleaner.dele...
@Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } }
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
CleanerChore extends ScheduledChore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir); checkAndDeleteEntries(files); } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); LOG.warn("Error while cleaning the logs", e); } } CleanerChore(String ...
@Test public void testNoExceptionFromDirectoryWithRacyChildren() throws Exception { Stoppable stop = new StoppableImplementation(); HBaseTestingUtility localUtil = new HBaseTestingUtility(); Configuration conf = localUtil.getConfiguration(); final Path testDir = UTIL.getDataTestDir(); final FileSystem fs = UTIL.getTest...
@VisibleForTesting boolean checkAndDeleteDirectory(Path dir) { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + dir); } try { FileStatus[] children = FSUtils.listStatus(fs, dir); boolean allChildrenDeleted = checkAndDeleteEntries(children); if (!allChildrenDeleted) return false; } catch (IOException e) { ...
CleanerChore extends ScheduledChore { @VisibleForTesting boolean checkAndDeleteDirectory(Path dir) { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + dir); } try { FileStatus[] children = FSUtils.listStatus(fs, dir); boolean allChildrenDeleted = checkAndDeleteEntries(children); if (!allChildrenDeleted) re...
CleanerChore extends ScheduledChore { @VisibleForTesting boolean checkAndDeleteDirectory(Path dir) { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + dir); } try { FileStatus[] children = FSUtils.listStatus(fs, dir); boolean allChildrenDeleted = checkAndDeleteEntries(children); if (!allChildrenDeleted) re...
CleanerChore extends ScheduledChore { @VisibleForTesting boolean checkAndDeleteDirectory(Path dir) { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + dir); } try { FileStatus[] children = FSUtils.listStatus(fs, dir); boolean allChildrenDeleted = checkAndDeleteEntries(children); if (!allChildrenDeleted) re...
CleanerChore extends ScheduledChore { @VisibleForTesting boolean checkAndDeleteDirectory(Path dir) { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + dir); } try { FileStatus[] children = FSUtils.listStatus(fs, dir); boolean allChildrenDeleted = checkAndDeleteEntries(children); if (!allChildrenDeleted) re...
@Test public void testFindsSnapshotFilesWhenCleaning() throws IOException { Configuration conf = TEST_UTIL.getConfiguration(); FSUtils.setRootDir(conf, TEST_UTIL.getDataTestDir()); Path rootDir = FSUtils.getRootDir(conf); FileSystem fs = FileSystem.get(conf); SnapshotLogCleaner cleaner = new SnapshotLogCleaner(); clean...
@Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( WAL_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_WAL_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtils.getRootDir(conf); cache = new SnapshotFileCache(fs...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( WAL_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_WAL_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtil...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( WAL_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_WAL_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtil...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( WAL_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_WAL_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtil...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( WAL_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_WAL_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtil...
@Test(timeout = 300000) public void testRecoveryAndDoubleExecutionOnline() throws Exception { final TableName tableName = TableName.valueOf("testRecoveryAndDoubleExecutionOnline"); this.util.createTable(tableName, HBaseTestingUtility.COLUMNS, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); try (Table t = this.util.getC...
@Override public ServerName getServerName() { return this.serverName; }
ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv, ServerCrashState> implements ServerProcedureInterface { @Override public ServerName getServerName() { return this.serverName; } }
ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv, ServerCrashState> implements ServerProcedureInterface { @Override public ServerName getServerName() { return this.serverName; } ServerCrashProcedure(final ServerName serverName, final boolean shouldSplitWal, final boolean carryingMeta); Serve...
ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv, ServerCrashState> implements ServerProcedureInterface { @Override public ServerName getServerName() { return this.serverName; } ServerCrashProcedure(final ServerName serverName, final boolean shouldSplitWal, final boolean carryingMeta); Serve...
ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv, ServerCrashState> implements ServerProcedureInterface { @Override public ServerName getServerName() { return this.serverName; } ServerCrashProcedure(final ServerName serverName, final boolean shouldSplitWal, final boolean carryingMeta); Serve...
@Test public void testIsStale() throws IOException { int period = 0; byte[][] families = new byte[][] {Bytes.toBytes("cf")}; byte[] qf = Bytes.toBytes("cq"); HRegionServer regionServer = mock(HRegionServer.class); List<Region> regions = new ArrayList<Region>(); when(regionServer.getOnlineRegionsLocalContext()).thenRetu...
@Override protected void chore() { for (Region r : regionServer.getOnlineRegionsLocalContext()) { if (!r.isReadOnly()) { continue; } if (onlyMetaRefresh && !r.getRegionInfo().isMetaTable()) continue; String encodedName = r.getRegionInfo().getEncodedName(); long time = EnvironmentEdgeManager.currentTime(); if (!lastRefr...
StorefileRefresherChore extends ScheduledChore { @Override protected void chore() { for (Region r : regionServer.getOnlineRegionsLocalContext()) { if (!r.isReadOnly()) { continue; } if (onlyMetaRefresh && !r.getRegionInfo().isMetaTable()) continue; String encodedName = r.getRegionInfo().getEncodedName(); long time = En...
StorefileRefresherChore extends ScheduledChore { @Override protected void chore() { for (Region r : regionServer.getOnlineRegionsLocalContext()) { if (!r.isReadOnly()) { continue; } if (onlyMetaRefresh && !r.getRegionInfo().isMetaTable()) continue; String encodedName = r.getRegionInfo().getEncodedName(); long time = En...
StorefileRefresherChore extends ScheduledChore { @Override protected void chore() { for (Region r : regionServer.getOnlineRegionsLocalContext()) { if (!r.isReadOnly()) { continue; } if (onlyMetaRefresh && !r.getRegionInfo().isMetaTable()) continue; String encodedName = r.getRegionInfo().getEncodedName(); long time = En...
StorefileRefresherChore extends ScheduledChore { @Override protected void chore() { for (Region r : regionServer.getOnlineRegionsLocalContext()) { if (!r.isReadOnly()) { continue; } if (onlyMetaRefresh && !r.getRegionInfo().isMetaTable()) continue; String encodedName = r.getRegionInfo().getEncodedName(); long time = En...
@Test public void testClearFiles() throws Exception { StripeStoreFileManager manager = createManager(); manager.insertNewFiles(al(createFile())); manager.insertNewFiles(al(createFile())); manager.addCompactionResults(al(), al(createFile(OPEN_KEY, KEY_B), createFile(KEY_B, OPEN_KEY))); assertEquals(4, manager.getStorefi...
@Override public ImmutableCollection<StoreFile> clearFiles() { ImmutableCollection<StoreFile> result = state.allFilesCached; this.state = new State(); this.fileStarts.clear(); this.fileEnds.clear(); return result; }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public ImmutableCollection<StoreFile> clearFiles() { ImmutableCollection<StoreFile> result = state.allFilesCached; this.state = new State(); this.fileStarts.clear(); this.fileEnds.clear(); return result; } }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public ImmutableCollection<StoreFile> clearFiles() { ImmutableCollection<StoreFile> result = state.allFilesCached; this.state = new State(); this.fileStarts.clear(); this.fileEnds.clear(); return result; } S...
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public ImmutableCollection<StoreFile> clearFiles() { ImmutableCollection<StoreFile> result = state.allFilesCached; this.state = new State(); this.fileStarts.clear(); this.fileEnds.clear(); return result; } S...
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public ImmutableCollection<StoreFile> clearFiles() { ImmutableCollection<StoreFile> result = state.allFilesCached; this.state = new State(); this.fileStarts.clear(); this.fileEnds.clear(); return result; } S...
@Test public void testPoll() throws InterruptedException { stealJobQueue.offer(3); stealFromQueue.offer(10); stealJobQueue.offer(15); stealJobQueue.offer(4); assertEquals(3, stealJobQueue.poll(1, TimeUnit.SECONDS).intValue()); assertEquals(4, stealJobQueue.poll(1, TimeUnit.SECONDS).intValue()); assertEquals("always tak...
@Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if (nanos <= 0) return null; nanos = notEmpty.awaitN...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
@Test @SuppressWarnings("unchecked") public void testLoadFilesWithRecoverableBadFiles() throws Exception { ArrayList<StoreFile> validStripeFiles = al(createFile(OPEN_KEY, KEY_B), createFile(KEY_B, KEY_C), createFile(KEY_C, OPEN_KEY), createFile(KEY_C, OPEN_KEY)); ArrayList<StoreFile> filesToGoToL0 = al(createFile(), cr...
@Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); @Override void loadFiles(Lis...
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); @Override void loadFiles(Lis...
@Test public void testLoadFilesWithBadStripe() throws Exception { ArrayList<StoreFile> allFilesToGo = al(createFile(OPEN_KEY, KEY_B), createFile(KEY_B, KEY_C), createFile(KEY_C, OPEN_KEY), createFile(KEY_B, keyAfter(KEY_B))); Collections.shuffle(allFilesToGo); StripeStoreFileManager manager = createManager(allFilesToGo...
@Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); }
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); @Override void loadFiles(Lis...
StripeStoreFileManager implements StoreFileManager, StripeCompactionPolicy.StripeInformationProvider { @Override public List<StoreFile> getLevel0Files() { return this.state.level0Files; } StripeStoreFileManager( KVComparator kvComparator, Configuration conf, StripeStoreConfig config); @Override void loadFiles(Lis...
@Test public void testEqualsWithLink() throws IOException { Path origin = new Path("/origin"); Path tmp = new Path("/tmp"); Path archive = new Path("/archive"); HFileLink link1 = new HFileLink(new Path(origin, "f1"), new Path(tmp, "f1"), new Path(archive, "f1")); HFileLink link2 = new HFileLink(new Path(origin, "f1"), ...
@Override public int hashCode() { int hash = 17; hash = hash * 31 + ((reference == null) ? 0 : reference.hashCode()); hash = hash * 31 + ((initialPath == null) ? 0 : initialPath.hashCode()); hash = hash * 31 + ((link == null) ? 0 : link.hashCode()); return hash; }
StoreFileInfo { @Override public int hashCode() { int hash = 17; hash = hash * 31 + ((reference == null) ? 0 : reference.hashCode()); hash = hash * 31 + ((initialPath == null) ? 0 : initialPath.hashCode()); hash = hash * 31 + ((link == null) ? 0 : link.hashCode()); return hash; } }
StoreFileInfo { @Override public int hashCode() { int hash = 17; hash = hash * 31 + ((reference == null) ? 0 : reference.hashCode()); hash = hash * 31 + ((initialPath == null) ? 0 : initialPath.hashCode()); hash = hash * 31 + ((link == null) ? 0 : link.hashCode()); return hash; } StoreFileInfo(final Configuration conf,...
StoreFileInfo { @Override public int hashCode() { int hash = 17; hash = hash * 31 + ((reference == null) ? 0 : reference.hashCode()); hash = hash * 31 + ((initialPath == null) ? 0 : initialPath.hashCode()); hash = hash * 31 + ((link == null) ? 0 : link.hashCode()); return hash; } StoreFileInfo(final Configuration conf,...
StoreFileInfo { @Override public int hashCode() { int hash = 17; hash = hash * 31 + ((reference == null) ? 0 : reference.hashCode()); hash = hash * 31 + ((initialPath == null) ? 0 : initialPath.hashCode()); hash = hash * 31 + ((link == null) ? 0 : link.hashCode()); return hash; } StoreFileInfo(final Configuration conf,...
@Test public void testNoEndWithoutStart() { ServerNonceManager nm = createManager(); try { nm.endOperation(NO_NONCE, 1, true); fail("Should have thrown"); } catch (AssertionError err) {} }
public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk = new NonceKey(group, nonce); OperationContext newResult = nonces.get(nk); assert newResult != null; synchronized (newResult) { assert newResult.getState() == OperationContext.WAIT; newResult.setSta...
ServerNonceManager { public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk = new NonceKey(group, nonce); OperationContext newResult = nonces.get(nk); assert newResult != null; synchronized (newResult) { assert newResult.getState() == OperationContext.W...
ServerNonceManager { public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk = new NonceKey(group, nonce); OperationContext newResult = nonces.get(nk); assert newResult != null; synchronized (newResult) { assert newResult.getState() == OperationContext.W...
ServerNonceManager { public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk = new NonceKey(group, nonce); OperationContext newResult = nonces.get(nk); assert newResult != null; synchronized (newResult) { assert newResult.getState() == OperationContext.W...
ServerNonceManager { public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk = new NonceKey(group, nonce); OperationContext newResult = nonces.get(nk); assert newResult != null; synchronized (newResult) { assert newResult.getState() == OperationContext.W...
@Test public void testSplitOffStripeOffPeak() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 2); StripeCompactionPolicy.StripeInformationProvider si = createStripesWithSizes(0, 0, new Long[] { defaultSplitSize - 2, 1L, 1L }); assertEquals(2, createPolic...
public StripeCompactionRequest selectCompaction(StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException { if (!filesCompacting.isEmpty()) { LOG.debug("Not selecting compaction: " + filesCompacting.size() + " files compacting"); return null; } Collection<StoreFile> allFiles =...
StripeCompactionPolicy extends CompactionPolicy { public StripeCompactionRequest selectCompaction(StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException { if (!filesCompacting.isEmpty()) { LOG.debug("Not selecting compaction: " + filesCompacting.size() + " files compacting"...
StripeCompactionPolicy extends CompactionPolicy { public StripeCompactionRequest selectCompaction(StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException { if (!filesCompacting.isEmpty()) { LOG.debug("Not selecting compaction: " + filesCompacting.size() + " files compacting"...
StripeCompactionPolicy extends CompactionPolicy { public StripeCompactionRequest selectCompaction(StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException { if (!filesCompacting.isEmpty()) { LOG.debug("Not selecting compaction: " + filesCompacting.size() + " files compacting"...
StripeCompactionPolicy extends CompactionPolicy { public StripeCompactionRequest selectCompaction(StripeInformationProvider si, List<StoreFile> filesCompacting, boolean isOffpeak) throws IOException { if (!filesCompacting.isEmpty()) { LOG.debug("Not selecting compaction: " + filesCompacting.size() + " files compacting"...
@Test public void testPuttingBackChunksAfterFlushing() throws UnexpectedStateException { byte[] row = Bytes.toBytes("testrow"); byte[] fam = Bytes.toBytes("testfamily"); byte[] qf1 = Bytes.toBytes("testqualifier1"); byte[] qf2 = Bytes.toBytes("testqualifier2"); byte[] qf3 = Bytes.toBytes("testqualifier3"); byte[] qf4 =...
int getPoolSize() { return this.reclaimedChunks.size(); }
MemStoreChunkPool { int getPoolSize() { return this.reclaimedChunks.size(); } }
MemStoreChunkPool { int getPoolSize() { return this.reclaimedChunks.size(); } MemStoreChunkPool(Configuration conf, int chunkSize, int maxCount, int initialCount); }
MemStoreChunkPool { int getPoolSize() { return this.reclaimedChunks.size(); } MemStoreChunkPool(Configuration conf, int chunkSize, int maxCount, int initialCount); }
MemStoreChunkPool { int getPoolSize() { return this.reclaimedChunks.size(); } MemStoreChunkPool(Configuration conf, int chunkSize, int maxCount, int initialCount); }
@Test public void testPutInStealQueueFromShouldUnblockPoll() throws InterruptedException { final AtomicInteger taken = new AtomicInteger(); Thread consumer = new Thread() { @Override public void run() { try { Integer n = stealJobQueue.poll(3, TimeUnit.SECONDS); taken.set(n); } catch (InterruptedException e) { e.printSt...
@Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if (nanos <= 0) return null; nanos = notEmpty.awaitN...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
@Test public void testRegionServerAbortionDueToFailureTransitioningToOpened() throws IOException, NodeExistsException, KeeperException { final Server server = new MockServer(HTU); final RegionServerServices rss = HTU.createMockRegionServerService(); HTableDescriptor htd = TEST_HTD; final HRegionInfo hri = TEST_HRI; HRe...
@Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regio...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
@Test public void testFailedOpenRegion() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = HTU.createMockRegionServerService(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager(); cs...
@Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regio...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
@Test public void testFailedUpdateMeta() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = HTU.createMockRegionServerService(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager(); cs...
@Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regio...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
@Test public void testTransitionToFailedOpenEvenIfCleanupFails() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = HTU.createMockRegionServerService(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZkCoordinatedStateManager csm = new ZkCoord...
@Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regio...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
@Test public void testTransitionToFailedOpenFromOffline() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = HTU.createMockRegionServerService(server.getServerName()); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZkCoordinatedStateManager cs...
@Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regio...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean openSuccessful = false; boolean transitionedToOpening = false; final String regionName = regionInfo.getRegionNameAsString(); HRegion region = null; try { if (this.server.isStopped() || this.rsServices.isStopping()) { r...
@Test public void testFailedFlushAborts() throws IOException, NodeExistsException, KeeperException { final Server server = new MockServer(HTU, false); final RegionServerServices rss = HTU.createMockRegionServerService(); HTableDescriptor htd = TEST_HTD; final HRegionInfo hri = new HRegionInfo(htd.getTableName(), HConst...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for reg...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
@Test public void testZKClosingNodeVersionMismatch() throws IOException, NodeExistsException, KeeperException, DeserializationException { final Server server = new MockServer(HTU); final RegionServerServices rss = HTU.createMockRegionServerService(); HTableDescriptor htd = TEST_HTD; final HRegionInfo hri = TEST_HRI; Zk...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for reg...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
@Test public void testCloseRegion() throws IOException, NodeExistsException, KeeperException, DeserializationException { final Server server = new MockServer(HTU); final RegionServerServices rss = HTU.createMockRegionServerService(); HTableDescriptor htd = TEST_HTD; HRegionInfo hri = TEST_HRI; ZkCoordinatedStateManager...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for reg...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName); if (region =...
@Test public void testCreateDefault() throws IOException { conf.setLong(HConstants.HREGION_MAX_FILESIZE, 1234L); ConstantSizeRegionSplitPolicy policy = (ConstantSizeRegionSplitPolicy)RegionSplitPolicy.create( mockRegion, conf); assertWithinJitter(1234L, policy.getDesiredMaxFileSize()); htd.setMaxFileSize(9999L); policy...
public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.configureForRegion(region); return policy; }
RegionSplitPolicy extends Configured { public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.configureForReg...
RegionSplitPolicy extends Configured { public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.configureForReg...
RegionSplitPolicy extends Configured { public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.configureForReg...
RegionSplitPolicy extends Configured { public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.configureForReg...
@Test public void testAddInStealJobQueueShouldUnblockPoll() throws InterruptedException { final AtomicInteger taken = new AtomicInteger(); Thread consumer = new Thread() { @Override public void run() { try { Integer n = stealJobQueue.poll(3, TimeUnit.SECONDS); taken.set(n); } catch (InterruptedException e) { e.printSta...
@Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if (nanos <= 0) return null; nanos = notEmpty.awaitN...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
StealJobQueue extends PriorityBlockingQueue<T> { @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); lock.lockInterruptibly(); try { while (true) { T retVal = this.poll(); if (retVal == null) { retVal = stealFromQueue.poll(); } if (retVal == null) { if ...
@Test public void testGetSplitPoint() throws IOException { ConstantSizeRegionSplitPolicy policy = (ConstantSizeRegionSplitPolicy)RegionSplitPolicy.create(mockRegion, conf); assertFalse(policy.shouldSplit()); assertNull(policy.getSplitPoint()); HStore mockStore = Mockito.mock(HStore.class); Mockito.doReturn(2000L).when(...
protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } List<Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Store s : stores) { byte[] splitPoint = s....
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } List<Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Sto...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } List<Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Sto...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } List<Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Sto...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } List<Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Sto...
@Test public void testWhenMemstoreAndBlockCacheMaxMinChecksFails() throws Exception { BlockCacheStub blockCache = new BlockCacheStub(0); MemstoreFlusherStub memStoreFlusher = new MemstoreFlusherStub(0); Configuration conf = HBaseConfiguration.create(); conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MAX_RANGE_KEY, 0.75f)...
public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server, RegionServerAccounting regionServerAccounting) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) ...
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server, RegionServerAccounting regionServerAccounting) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((R...
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server, RegionServerAccounting regionServerAccounting) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((R...
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server, RegionServerAccounting regionServerAccounting) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((R...
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server, RegionServerAccounting regionServerAccounting) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((R...
@Test public void testCompactionContextForceSelect() throws Exception { Configuration conf = HBaseConfiguration.create(); int targetCount = 2; conf.setInt(StripeStoreConfig.INITIAL_STRIPE_COUNT_KEY, targetCount); conf.setInt(StripeStoreConfig.MIN_FILES_L0_KEY, 2); conf.set(StoreEngine.STORE_ENGINE_CLASS_KEY, TestStoreE...
@Override public CompactionContext createCompaction() { return new StripeCompaction(); }
StripeStoreEngine extends StoreEngine<StripeStoreFlusher, StripeCompactionPolicy, StripeCompactor, StripeStoreFileManager> { @Override public CompactionContext createCompaction() { return new StripeCompaction(); } }
StripeStoreEngine extends StoreEngine<StripeStoreFlusher, StripeCompactionPolicy, StripeCompactor, StripeStoreFileManager> { @Override public CompactionContext createCompaction() { return new StripeCompaction(); } }
StripeStoreEngine extends StoreEngine<StripeStoreFlusher, StripeCompactionPolicy, StripeCompactor, StripeStoreFileManager> { @Override public CompactionContext createCompaction() { return new StripeCompaction(); } @Override boolean needsCompaction(List<StoreFile> filesCompacting); @Override CompactionContext createC...
StripeStoreEngine extends StoreEngine<StripeStoreFlusher, StripeCompactionPolicy, StripeCompactor, StripeStoreFileManager> { @Override public CompactionContext createCompaction() { return new StripeCompaction(); } @Override boolean needsCompaction(List<StoreFile> filesCompacting); @Override CompactionContext createC...
@Test public void testLogRollRequested() throws Exception { MetricsWALSource source = mock(MetricsWALSourceImpl.class); MetricsWAL metricsWAL = new MetricsWAL(source); metricsWAL.logRollRequested(false); metricsWAL.logRollRequested(true); verify(source, times(2)).incrementLogRollRequested(); verify(source, times(1)).in...
@Override public void logRollRequested(boolean underReplicated) { source.incrementLogRollRequested(); if (underReplicated) { source.incrementLowReplicationLogRoll(); } }
MetricsWAL extends WALActionsListener.Base { @Override public void logRollRequested(boolean underReplicated) { source.incrementLogRollRequested(); if (underReplicated) { source.incrementLowReplicationLogRoll(); } } }
MetricsWAL extends WALActionsListener.Base { @Override public void logRollRequested(boolean underReplicated) { source.incrementLogRollRequested(); if (underReplicated) { source.incrementLowReplicationLogRoll(); } } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); }
MetricsWAL extends WALActionsListener.Base { @Override public void logRollRequested(boolean underReplicated) { source.incrementLogRollRequested(); if (underReplicated) { source.incrementLowReplicationLogRoll(); } } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); @Override void postSync(final long time...
MetricsWAL extends WALActionsListener.Base { @Override public void logRollRequested(boolean underReplicated) { source.incrementLogRollRequested(); if (underReplicated) { source.incrementLowReplicationLogRoll(); } } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); @Override void postSync(final long time...
@Test public void testPostSync() throws Exception { long nanos = TimeUnit.MILLISECONDS.toNanos(145); MetricsWALSource source = mock(MetricsWALSourceImpl.class); MetricsWAL metricsWAL = new MetricsWAL(source); metricsWAL.postSync(nanos, 1); verify(source, times(1)).incrementSyncTime(145); }
@Override public void postSync(final long timeInNanos, final int handlerSyncs) { source.incrementSyncTime(timeInNanos/1000000L); }
MetricsWAL extends WALActionsListener.Base { @Override public void postSync(final long timeInNanos, final int handlerSyncs) { source.incrementSyncTime(timeInNanos/1000000L); } }
MetricsWAL extends WALActionsListener.Base { @Override public void postSync(final long timeInNanos, final int handlerSyncs) { source.incrementSyncTime(timeInNanos/1000000L); } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); }
MetricsWAL extends WALActionsListener.Base { @Override public void postSync(final long timeInNanos, final int handlerSyncs) { source.incrementSyncTime(timeInNanos/1000000L); } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); @Override void postSync(final long timeInNanos, final int handlerSyncs); @Over...
MetricsWAL extends WALActionsListener.Base { @Override public void postSync(final long timeInNanos, final int handlerSyncs) { source.incrementSyncTime(timeInNanos/1000000L); } MetricsWAL(); @VisibleForTesting MetricsWAL(MetricsWALSource s); @Override void postSync(final long timeInNanos, final int handlerSyncs); @Over...
@Test public void testSyncRunnerIndexOverflow() throws IOException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { final String name = "testSyncRunnerIndexOverflow"; FSHLog log = new FSHLog(fs, FSUtils.getRootDir(conf), name, HConstants.HREGION_OLDLOGDIR_NAME, conf, null, tr...
@Override public void close() throws IOException { shutdown(); final FileStatus[] files = getFiles(); if (null != files && 0 != files.length) { for (FileStatus file : files) { Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath()); if (!this.listeners.isEmpty()) { for (WALActionsListener i : this.listeners...
FSHLog implements WAL { @Override public void close() throws IOException { shutdown(); final FileStatus[] files = getFiles(); if (null != files && 0 != files.length) { for (FileStatus file : files) { Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath()); if (!this.listeners.isEmpty()) { for (WALActionsLis...
FSHLog implements WAL { @Override public void close() throws IOException { shutdown(); final FileStatus[] files = getFiles(); if (null != files && 0 != files.length) { for (FileStatus file : files) { Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath()); if (!this.listeners.isEmpty()) { for (WALActionsLis...
FSHLog implements WAL { @Override public void close() throws IOException { shutdown(); final FileStatus[] files = getFiles(); if (null != files && 0 != files.length) { for (FileStatus file : files) { Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath()); if (!this.listeners.isEmpty()) { for (WALActionsLis...
FSHLog implements WAL { @Override public void close() throws IOException { shutdown(); final FileStatus[] files = getFiles(); if (null != files && 0 != files.length) { for (FileStatus file : files) { Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath()); if (!this.listeners.isEmpty()) { for (WALActionsLis...
@Test public void testStartCacheFlush() { SequenceIdAccounting sida = new SequenceIdAccounting(); sida.getOrCreateLowestSequenceIds(ENCODED_REGION_NAME); Map<byte[], Long> m = new HashMap<byte[], Long>(); m.put(ENCODED_REGION_NAME, HConstants.NO_SEQNUM); assertEquals(HConstants.NO_SEQNUM, (long)sida.startCacheFlush(ENC...
Long startCacheFlush(final byte[] encodedRegionName, final Set<byte[]> families) { Map<byte[], Long> oldSequenceIds = null; Long lowestUnflushedInRegion = HConstants.NO_SEQNUM; synchronized (tieLock) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(encodedRegionName); if (m != null) { for (byte[] familyName:...
SequenceIdAccounting { Long startCacheFlush(final byte[] encodedRegionName, final Set<byte[]> families) { Map<byte[], Long> oldSequenceIds = null; Long lowestUnflushedInRegion = HConstants.NO_SEQNUM; synchronized (tieLock) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(encodedRegionName); if (m != null) { ...
SequenceIdAccounting { Long startCacheFlush(final byte[] encodedRegionName, final Set<byte[]> families) { Map<byte[], Long> oldSequenceIds = null; Long lowestUnflushedInRegion = HConstants.NO_SEQNUM; synchronized (tieLock) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(encodedRegionName); if (m != null) { ...
SequenceIdAccounting { Long startCacheFlush(final byte[] encodedRegionName, final Set<byte[]> families) { Map<byte[], Long> oldSequenceIds = null; Long lowestUnflushedInRegion = HConstants.NO_SEQNUM; synchronized (tieLock) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(encodedRegionName); if (m != null) { ...
SequenceIdAccounting { Long startCacheFlush(final byte[] encodedRegionName, final Set<byte[]> families) { Map<byte[], Long> oldSequenceIds = null; Long lowestUnflushedInRegion = HConstants.NO_SEQNUM; synchronized (tieLock) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(encodedRegionName); if (m != null) { ...
@Test public void testAreAllLower() { SequenceIdAccounting sida = new SequenceIdAccounting(); sida.getOrCreateLowestSequenceIds(ENCODED_REGION_NAME); Map<byte[], Long> m = new HashMap<byte[], Long>(); m.put(ENCODED_REGION_NAME, HConstants.NO_SEQNUM); assertTrue(sida.areAllLower(m)); long sequenceid = 1; sida.update(ENC...
boolean areAllLower(Map<byte[], Long> sequenceids) { Map<byte[], Long> flushing = null; Map<byte[], Long> unflushed = null; synchronized (this.tieLock) { flushing = flattenToLowestSequenceId(this.flushingSequenceIds); unflushed = flattenToLowestSequenceId(this.lowestUnflushedSequenceIds); } for (Map.Entry<byte[], Long>...
SequenceIdAccounting { boolean areAllLower(Map<byte[], Long> sequenceids) { Map<byte[], Long> flushing = null; Map<byte[], Long> unflushed = null; synchronized (this.tieLock) { flushing = flattenToLowestSequenceId(this.flushingSequenceIds); unflushed = flattenToLowestSequenceId(this.lowestUnflushedSequenceIds); } for (...
SequenceIdAccounting { boolean areAllLower(Map<byte[], Long> sequenceids) { Map<byte[], Long> flushing = null; Map<byte[], Long> unflushed = null; synchronized (this.tieLock) { flushing = flattenToLowestSequenceId(this.flushingSequenceIds); unflushed = flattenToLowestSequenceId(this.lowestUnflushedSequenceIds); } for (...
SequenceIdAccounting { boolean areAllLower(Map<byte[], Long> sequenceids) { Map<byte[], Long> flushing = null; Map<byte[], Long> unflushed = null; synchronized (this.tieLock) { flushing = flattenToLowestSequenceId(this.flushingSequenceIds); unflushed = flattenToLowestSequenceId(this.lowestUnflushedSequenceIds); } for (...
SequenceIdAccounting { boolean areAllLower(Map<byte[], Long> sequenceids) { Map<byte[], Long> flushing = null; Map<byte[], Long> unflushed = null; synchronized (this.tieLock) { flushing = flattenToLowestSequenceId(this.flushingSequenceIds); unflushed = flattenToLowestSequenceId(this.lowestUnflushedSequenceIds); } for (...
@Test public void testInteractWithThreadPool() throws InterruptedException { StealJobQueue<Runnable> stealTasksQueue = new StealJobQueue<>(); final CountDownLatch stealJobCountDown = new CountDownLatch(3); final CountDownLatch stealFromCountDown = new CountDownLatch(3); ThreadPoolExecutor stealPool = new ThreadPoolExec...
public BlockingQueue<T> getStealFromQueue() { return stealFromQueue; }
StealJobQueue extends PriorityBlockingQueue<T> { public BlockingQueue<T> getStealFromQueue() { return stealFromQueue; } }
StealJobQueue extends PriorityBlockingQueue<T> { public BlockingQueue<T> getStealFromQueue() { return stealFromQueue; } StealJobQueue(); }
StealJobQueue extends PriorityBlockingQueue<T> { public BlockingQueue<T> getStealFromQueue() { return stealFromQueue; } StealJobQueue(); BlockingQueue<T> getStealFromQueue(); @Override boolean offer(T t); @Override T take(); @Override T poll(long timeout, TimeUnit unit); }
StealJobQueue extends PriorityBlockingQueue<T> { public BlockingQueue<T> getStealFromQueue() { return stealFromQueue; } StealJobQueue(); BlockingQueue<T> getStealFromQueue(); @Override boolean offer(T t); @Override T take(); @Override T poll(long timeout, TimeUnit unit); }
@Test public void testFindLower() { SequenceIdAccounting sida = new SequenceIdAccounting(); sida.getOrCreateLowestSequenceIds(ENCODED_REGION_NAME); Map<byte[], Long> m = new HashMap<byte[], Long>(); m.put(ENCODED_REGION_NAME, HConstants.NO_SEQNUM); long sequenceid = 1; sida.update(ENCODED_REGION_NAME, FAMILIES, sequenc...
byte[][] findLower(Map<byte[], Long> sequenceids) { List<byte[]> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e: sequenceids.entrySet()) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) continue; long lowest = getLowestSequenceId(m); if (lowest != HConstan...
SequenceIdAccounting { byte[][] findLower(Map<byte[], Long> sequenceids) { List<byte[]> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e: sequenceids.entrySet()) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) continue; long lowest = getLowestSequenceId(m);...
SequenceIdAccounting { byte[][] findLower(Map<byte[], Long> sequenceids) { List<byte[]> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e: sequenceids.entrySet()) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) continue; long lowest = getLowestSequenceId(m);...
SequenceIdAccounting { byte[][] findLower(Map<byte[], Long> sequenceids) { List<byte[]> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e: sequenceids.entrySet()) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) continue; long lowest = getLowestSequenceId(m);...
SequenceIdAccounting { byte[][] findLower(Map<byte[], Long> sequenceids) { List<byte[]> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e: sequenceids.entrySet()) { Map<byte[], Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) continue; long lowest = getLowestSequenceId(m);...
@Test(timeout=60000) public void testAcquireTaskAtStartup() throws Exception { LOG.info("testAcquireTaskAtStartup"); SplitLogCounters.resetCounters(); final String TATAS = "tatas"; final ServerName RS = ServerName.valueOf("rs,1,1"); RegionServerServices mockedRS = getRegionServer(RS); zkw.getRecoverableZooKeeper().crea...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
@Test(timeout=60000) public void testRaceForTask() throws Exception { LOG.info("testRaceForTask"); SplitLogCounters.resetCounters(); final String TRFT = "trft"; final ServerName SVR1 = ServerName.valueOf("svr1,1,1"); final ServerName SVR2 = ServerName.valueOf("svr2,1,1"); zkw.getRecoverableZooKeeper().create(ZKSplitLog...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
@Test(timeout=60000) public void testRescan() throws Exception { LOG.info("testRescan"); SplitLogCounters.resetCounters(); final ServerName SRV = ServerName.valueOf("svr,1,1"); RegionServerServices mockedRS = getRegionServer(SRV); slw = new SplitLogWorker(ds, TEST_UTIL.getConfiguration(), mockedRS, neverEndingTask); sl...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
@Test(timeout=60000) public void testAcquireMultiTasks() throws Exception { LOG.info("testAcquireMultiTasks"); SplitLogCounters.resetCounters(); final String TATAS = "tatas"; final ServerName RS = ServerName.valueOf("rs,1,1"); final int maxTasks = 3; Configuration testConf = HBaseConfiguration.create(TEST_UTIL.getConfi...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
@Test(timeout=60000) public void testAcquireMultiTasksByAvgTasksPerRS() throws Exception { LOG.info("testAcquireMultiTasks"); SplitLogCounters.resetCounters(); final String TATAS = "tatas"; final ServerName RS = ServerName.valueOf("rs,1,1"); final ServerName RS2 = ServerName.valueOf("rs,1,2"); final int maxTasks = 3; C...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } }
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
SplitLogWorker implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + server.getServerName().toShortString()); worker.start(); } SplitLogWorker(Server hserver, Configuration conf, RegionServerServices server, TaskExecutor splitTaskExecutor); SplitLogWorker(final Server hs...
@Test public void testGetWhileRegionClose() throws IOException { TableName tableName = TableName.valueOf(name.getMethodName()); Configuration hc = initSplit(); int numRows = 100; byte[][] families = { fam1, fam2, fam3 }; String method = name.getMethodName(); this.region = initHRegion(tableName, method, hc, families); t...
public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); }
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } }
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
@Test public void testWeirdCacheBehaviour() throws Exception { byte[] TABLE = Bytes.toBytes("testWeirdCacheBehaviour"); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("trans-blob"), Bytes.toBytes("trans-type"), Bytes.toBytes("trans-date"), Bytes.toBytes("trans-tags"), Bytes.toBytes("trans-group") }; this.region = ini...
public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); }
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } }
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static void closeHRegion(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); } @Deprecated @VisibleForTesting HRegion(final Path tableDir, final WAL wal, final Fi...
@Test public void testMerge() throws IOException { byte[][] families = { fam1, fam2, fam3 }; Configuration hc = initSplit(); String method = this.getName(); this.region = initHRegion(tableName, method, hc, families); try { LOG.info("" + HBaseTestCase.addContent(region, fam3)); region.flush(true); region.compactStores()...
public static HRegion merge(final HRegion a, final HRegion b) throws IOException { if (!a.getRegionInfo().getTable().equals(b.getRegionInfo().getTable())) { throw new IOException("Regions do not belong to the same table"); } FileSystem fs = a.getRegionFileSystem().getFileSystem(); a.flush(true); b.flush(true); a.compac...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static HRegion merge(final HRegion a, final HRegion b) throws IOException { if (!a.getRegionInfo().getTable().equals(b.getRegionInfo().getTable())) { throw new IOException("Regions do not belong to the same table"); } FileSystem fs = a.getRe...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static HRegion merge(final HRegion a, final HRegion b) throws IOException { if (!a.getRegionInfo().getTable().equals(b.getRegionInfo().getTable())) { throw new IOException("Regions do not belong to the same table"); } FileSystem fs = a.getRe...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static HRegion merge(final HRegion a, final HRegion b) throws IOException { if (!a.getRegionInfo().getTable().equals(b.getRegionInfo().getTable())) { throw new IOException("Regions do not belong to the same table"); } FileSystem fs = a.getRe...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { public static HRegion merge(final HRegion a, final HRegion b) throws IOException { if (!a.getRegionInfo().getTable().equals(b.getRegionInfo().getTable())) { throw new IOException("Regions do not belong to the same table"); } FileSystem fs = a.getRe...
@Test public void testgetHDFSBlocksDistribution() throws Exception { HBaseTestingUtility htu = new HBaseTestingUtility(); htu.getConfiguration().setInt("dfs.replication", 2); MiniHBaseCluster cluster = null; String dataNodeHosts[] = new String[] { "host1", "host2", "host3" }; int regionServersCount = 3; try { cluster =...
@Override public HDFSBlocksDistribution getHDFSBlocksDistribution() { HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution(); synchronized (this.stores) { for (Store store : this.stores.values()) { Collection<StoreFile> storeFiles = store.getStorefiles(); if (storeFiles == null) continue; for (Sto...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { @Override public HDFSBlocksDistribution getHDFSBlocksDistribution() { HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution(); synchronized (this.stores) { for (Store store : this.stores.values()) { Collection<StoreFile> storeF...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { @Override public HDFSBlocksDistribution getHDFSBlocksDistribution() { HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution(); synchronized (this.stores) { for (Store store : this.stores.values()) { Collection<StoreFile> storeF...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { @Override public HDFSBlocksDistribution getHDFSBlocksDistribution() { HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution(); synchronized (this.stores) { for (Store store : this.stores.values()) { Collection<StoreFile> storeF...
HRegion implements HeapSize, PropagatingConfigurationObserver, Region { @Override public HDFSBlocksDistribution getHDFSBlocksDistribution() { HDFSBlocksDistribution hdfsBlocksDistribution = new HDFSBlocksDistribution(); synchronized (this.stores) { for (Store store : this.stores.values()) { Collection<StoreFile> storeF...
@Test public void testMultipleClients() throws Exception { ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS); try { ExecutorCompletionService<Boolean> ecs = new ExecutorCompletionService<Boolean>(exec); for (int i = 0; i < NUM_THREADS; ++i) ecs.submit(new IdLockTestThread("client_" + i)); for (int i = 0;...
void assertMapEmpty() { assert map.size() == 0; }
IdLock { void assertMapEmpty() { assert map.size() == 0; } }
IdLock { void assertMapEmpty() { assert map.size() == 0; } }
IdLock { void assertMapEmpty() { assert map.size() == 0; } Entry getLockEntry(long id); void releaseLockEntry(Entry entry); @VisibleForTesting void waitForWaiters(long id, int numWaiters); }
IdLock { void assertMapEmpty() { assert map.size() == 0; } Entry getLockEntry(long id); void releaseLockEntry(Entry entry); @VisibleForTesting void waitForWaiters(long id, int numWaiters); }
@Test public void testReadSnapshotManifest() throws IOException { try { SnapshotManifest.open(conf, fs, snapshotDir, snapshotDesc); fail("fail to test snapshot manifest because message size is too small."); } catch (InvalidProtocolBufferException ipbe) { try { conf.setInt(SnapshotManifest.SNAPSHOT_MANIFEST_SIZE_LIMIT_C...
public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; }
SnapshotManifest { public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; } }
SnapshotManifest { public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; } private SnapshotManif...
SnapshotManifest { public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; } private SnapshotManif...
SnapshotManifest { public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; } private SnapshotManif...
@Test public void testBalanceSplit() throws Exception { List<Pair<SnapshotFileInfo, Long>> files = new ArrayList<Pair<SnapshotFileInfo, Long>>(); for (long i = 0; i <= 20; i++) { SnapshotFileInfo fileInfo = SnapshotFileInfo.newBuilder() .setType(SnapshotFileInfo.Type.HFILE) .setHfile("file-" + i) .build(); files.add(ne...
static List<List<Pair<SnapshotFileInfo, Long>>> getBalancedSplits( final List<Pair<SnapshotFileInfo, Long>> files, final int ngroups) { Collections.sort(files, new Comparator<Pair<SnapshotFileInfo, Long>>() { public int compare(Pair<SnapshotFileInfo, Long> a, Pair<SnapshotFileInfo, Long> b) { long r = a.getSecond() - b...
ExportSnapshot extends Configured implements Tool { static List<List<Pair<SnapshotFileInfo, Long>>> getBalancedSplits( final List<Pair<SnapshotFileInfo, Long>> files, final int ngroups) { Collections.sort(files, new Comparator<Pair<SnapshotFileInfo, Long>>() { public int compare(Pair<SnapshotFileInfo, Long> a, Pair<Sna...
ExportSnapshot extends Configured implements Tool { static List<List<Pair<SnapshotFileInfo, Long>>> getBalancedSplits( final List<Pair<SnapshotFileInfo, Long>> files, final int ngroups) { Collections.sort(files, new Comparator<Pair<SnapshotFileInfo, Long>>() { public int compare(Pair<SnapshotFileInfo, Long> a, Pair<Sna...
ExportSnapshot extends Configured implements Tool { static List<List<Pair<SnapshotFileInfo, Long>>> getBalancedSplits( final List<Pair<SnapshotFileInfo, Long>> files, final int ngroups) { Collections.sort(files, new Comparator<Pair<SnapshotFileInfo, Long>>() { public int compare(Pair<SnapshotFileInfo, Long> a, Pair<Sna...
ExportSnapshot extends Configured implements Tool { static List<List<Pair<SnapshotFileInfo, Long>>> getBalancedSplits( final List<Pair<SnapshotFileInfo, Long>> files, final int ngroups) { Collections.sort(files, new Comparator<Pair<SnapshotFileInfo, Long>>() { public int compare(Pair<SnapshotFileInfo, Long> a, Pair<Sna...
@Test public void testValidateMissingTableName() { Configuration conf = new Configuration(false); try { SnapshotDescriptionUtils.validate(SnapshotDescription.newBuilder().setName("fail").build(), conf); fail("Snapshot was considered valid without a table name"); } catch (IllegalArgumentException e) { LOG.debug("Correct...
public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.getCreationTime(); if (time == SnapshotDesc...
SnapshotDescriptionUtils { public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.getCreationTime(...
SnapshotDescriptionUtils { public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.getCreationTime(...
SnapshotDescriptionUtils { public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.getCreationTime(...
SnapshotDescriptionUtils { public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.getCreationTime(...
@Test public void testCompleteSnapshotWithNoSnapshotDirectoryFailure() throws Exception { Path snapshotDir = new Path(root, HConstants.SNAPSHOT_DIR_NAME); Path tmpDir = new Path(snapshotDir, ".tmp"); Path workingDir = new Path(tmpDir, "not_a_snapshot"); assertFalse("Already have working snapshot dir: " + workingDir + "...
public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot from " + workingDir + " to " + finishedDir)...
SnapshotDescriptionUtils { public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot from " + working...
SnapshotDescriptionUtils { public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot from " + working...
SnapshotDescriptionUtils { public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot from " + working...
SnapshotDescriptionUtils { public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot from " + working...
@Test public void testStart() throws Exception { JMXConnector connector = JMXConnectorFactory.connect( JMXListener.buildJMXServiceURL(connectorPort,connectorPort)); MBeanServerConnection mb = connector.getMBeanServerConnection(); String domain = mb.getDefaultDomain(); Assert.assertTrue("default domain is not correct", ...
@Override public void start(CoprocessorEnvironment env) throws IOException { int rmiRegistryPort = -1; int rmiConnectorPort = -1; Configuration conf = env.getConfiguration(); if (env instanceof MasterCoprocessorEnvironment) { rmiRegistryPort = conf.getInt("master" + RMI_REGISTRY_PORT_CONF_KEY, defMasterRMIRegistryPort)...
JMXListener implements Coprocessor { @Override public void start(CoprocessorEnvironment env) throws IOException { int rmiRegistryPort = -1; int rmiConnectorPort = -1; Configuration conf = env.getConfiguration(); if (env instanceof MasterCoprocessorEnvironment) { rmiRegistryPort = conf.getInt("master" + RMI_REGISTRY_POR...
JMXListener implements Coprocessor { @Override public void start(CoprocessorEnvironment env) throws IOException { int rmiRegistryPort = -1; int rmiConnectorPort = -1; Configuration conf = env.getConfiguration(); if (env instanceof MasterCoprocessorEnvironment) { rmiRegistryPort = conf.getInt("master" + RMI_REGISTRY_POR...
JMXListener implements Coprocessor { @Override public void start(CoprocessorEnvironment env) throws IOException { int rmiRegistryPort = -1; int rmiConnectorPort = -1; Configuration conf = env.getConfiguration(); if (env instanceof MasterCoprocessorEnvironment) { rmiRegistryPort = conf.getInt("master" + RMI_REGISTRY_POR...
JMXListener implements Coprocessor { @Override public void start(CoprocessorEnvironment env) throws IOException { int rmiRegistryPort = -1; int rmiConnectorPort = -1; Configuration conf = env.getConfiguration(); if (env instanceof MasterCoprocessorEnvironment) { rmiRegistryPort = conf.getInt("master" + RMI_REGISTRY_POR...
@Test public void testStop() throws Exception { MiniHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); cluster.waitUntilShutDown(); JMXConnector connector = JMXConnectorFactory.newJMXConnector( JMXListener.buildJM...
@Override public void stop(CoprocessorEnvironment env) throws IOException { stopConnectorServer(); }
JMXListener implements Coprocessor { @Override public void stop(CoprocessorEnvironment env) throws IOException { stopConnectorServer(); } }
JMXListener implements Coprocessor { @Override public void stop(CoprocessorEnvironment env) throws IOException { stopConnectorServer(); } }
JMXListener implements Coprocessor { @Override public void stop(CoprocessorEnvironment env) throws IOException { stopConnectorServer(); } static JMXServiceURL buildJMXServiceURL(int rmiRegistryPort, int rmiConnectorPort); void startConnectorServer(int rmiRegistryPort, int rmiConnectorPort); void stopConnectorSer...
JMXListener implements Coprocessor { @Override public void stop(CoprocessorEnvironment env) throws IOException { stopConnectorServer(); } static JMXServiceURL buildJMXServiceURL(int rmiRegistryPort, int rmiConnectorPort); void startConnectorServer(int rmiRegistryPort, int rmiConnectorPort); void stopConnectorSer...
@Test public void testHeapSize() { Cell originalCell = CellUtil.createCell(Bytes.toBytes("row"), Bytes.toBytes("value")); final int fakeTagArrayLength = 10; TagRewriteCell trCell = new TagRewriteCell(originalCell, new byte[fakeTagArrayLength]); long trCellHeapSize = trCell.heapSize(); TagRewriteCell trCell2 = new TagRe...
@Override public long heapSize() { long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength(); sum += ClassSize.OBJECT; sum += (2 * ClassSize.REFERENCE); if (this.tags != null) { sum += ClassSize.align(ClassSize.ARRAY); sum += this.tags.length; } return sum; }
TagRewriteCell implements Cell, SettableSequenceId, SettableTimestamp, HeapSize { @Override public long heapSize() { long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength(); sum += ClassSize.OBJECT; sum += (2 * ClassSize.REFERENCE); if (this.tags != null) { sum += ClassSize.align(ClassSize.ARRAY); sum += t...
TagRewriteCell implements Cell, SettableSequenceId, SettableTimestamp, HeapSize { @Override public long heapSize() { long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength(); sum += ClassSize.OBJECT; sum += (2 * ClassSize.REFERENCE); if (this.tags != null) { sum += ClassSize.align(ClassSize.ARRAY); sum += t...
TagRewriteCell implements Cell, SettableSequenceId, SettableTimestamp, HeapSize { @Override public long heapSize() { long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength(); sum += ClassSize.OBJECT; sum += (2 * ClassSize.REFERENCE); if (this.tags != null) { sum += ClassSize.align(ClassSize.ARRAY); sum += t...
TagRewriteCell implements Cell, SettableSequenceId, SettableTimestamp, HeapSize { @Override public long heapSize() { long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength(); sum += ClassSize.OBJECT; sum += (2 * ClassSize.REFERENCE); if (this.tags != null) { sum += ClassSize.align(ClassSize.ARRAY); sum += t...
@Test public void testLocker(){ KeyLocker<String> locker = new KeyLocker<String>(); ReentrantLock lock1 = locker.acquireLock("l1"); Assert.assertTrue(lock1.isHeldByCurrentThread()); ReentrantLock lock2 = locker.acquireLock("l2"); Assert.assertTrue(lock2.isHeldByCurrentThread()); Assert.assertTrue(lock1 != lock2); Reent...
public ReentrantLock acquireLock(K key) { if (key == null) throw new IllegalArgumentException("key must not be null"); lockPool.purge(); ReentrantLock lock = lockPool.get(key); lock.lock(); return lock; }
KeyLocker { public ReentrantLock acquireLock(K key) { if (key == null) throw new IllegalArgumentException("key must not be null"); lockPool.purge(); ReentrantLock lock = lockPool.get(key); lock.lock(); return lock; } }
KeyLocker { public ReentrantLock acquireLock(K key) { if (key == null) throw new IllegalArgumentException("key must not be null"); lockPool.purge(); ReentrantLock lock = lockPool.get(key); lock.lock(); return lock; } }
KeyLocker { public ReentrantLock acquireLock(K key) { if (key == null) throw new IllegalArgumentException("key must not be null"); lockPool.purge(); ReentrantLock lock = lockPool.get(key); lock.lock(); return lock; } ReentrantLock acquireLock(K key); Map<K, Lock> acquireLocks(Set<? extends K> keys); }
KeyLocker { public ReentrantLock acquireLock(K key) { if (key == null) throw new IllegalArgumentException("key must not be null"); lockPool.purge(); ReentrantLock lock = lockPool.get(key); lock.lock(); return lock; } ReentrantLock acquireLock(K key); Map<K, Lock> acquireLocks(Set<? extends K> keys); }
@Test public void testLoadClassFromLocalPath() throws Exception { ClassLoader parent = TestDynamicClassLoader.class.getClassLoader(); DynamicClassLoader classLoader = new DynamicClassLoader(conf, parent); String className = "TestLoadClassFromLocalPath"; deleteClass(className); try { classLoader.loadClass(className); fa...
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJars) { return tryRefreshClass(name); } throw e...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
@Test public void testLoadClassFromAnotherPath() throws Exception { ClassLoader parent = TestDynamicClassLoader.class.getClassLoader(); DynamicClassLoader classLoader = new DynamicClassLoader(conf, parent); String className = "TestLoadClassFromAnotherPath"; deleteClass(className); try { classLoader.loadClass(className)...
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJars) { return tryRefreshClass(name); } throw e...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
@Test (timeout=180000) public void testHBaseFsck() throws Exception { assertNoErrors(doFsck(conf, false)); TableName table = TableName.valueOf("tableBadMetaAssign"); HTableDescriptor desc = new HTableDescriptor(table); HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM)); desc.addFamily(hcd); createTable(...
public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { this(conf, createThreadPool(conf)); }
HBaseFsck extends Configured implements Closeable { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { this(conf, createThreadPool(conf)); } }
HBaseFsck extends Configured implements Closeable { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { this(conf, createThreadPool(conf)); } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); }
HBaseFsck extends Configured implements Closeable { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { this(conf, createThreadPool(conf)); } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void c...
HBaseFsck extends Configured implements Closeable { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { this(conf, createThreadPool(conf)); } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void c...
@Test public void testAppenderDefined() { HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender(); requestLogAppender.setName("testrequestlog"); Logger.getLogger("http.requests.test").addAppender(requestLogAppender); RequestLog requestLog = HttpRequestLog.getRequestLog("test"); Logger.getLogger("http.r...
public static RequestLog getRequestLog(String name) { String lookup = serverToComponent.get(name); if (lookup != null) { name = lookup; } String loggerName = "http.requests." + name; String appenderName = name + "requestlog"; Log logger = LogFactory.getLog(loggerName); if (logger instanceof Log4JLogger) { Log4JLogger h...
HttpRequestLog { public static RequestLog getRequestLog(String name) { String lookup = serverToComponent.get(name); if (lookup != null) { name = lookup; } String loggerName = "http.requests." + name; String appenderName = name + "requestlog"; Log logger = LogFactory.getLog(loggerName); if (logger instanceof Log4JLogger...
HttpRequestLog { public static RequestLog getRequestLog(String name) { String lookup = serverToComponent.get(name); if (lookup != null) { name = lookup; } String loggerName = "http.requests." + name; String appenderName = name + "requestlog"; Log logger = LogFactory.getLog(loggerName); if (logger instanceof Log4JLogger...
HttpRequestLog { public static RequestLog getRequestLog(String name) { String lookup = serverToComponent.get(name); if (lookup != null) { name = lookup; } String loggerName = "http.requests." + name; String appenderName = name + "requestlog"; Log logger = LogFactory.getLog(loggerName); if (logger instanceof Log4JLogger...
HttpRequestLog { public static RequestLog getRequestLog(String name) { String lookup = serverToComponent.get(name); if (lookup != null) { name = lookup; } String loggerName = "http.requests." + name; String appenderName = name + "requestlog"; Log logger = LogFactory.getLog(loggerName); if (logger instanceof Log4JLogger...
@Test public void testLoadClassFromLocalPathWithDynamicDirOff() throws Exception { conf.setBoolean("hbase.use.dynamic.jars", false); ClassLoader parent = TestDynamicClassLoader.class.getClassLoader(); DynamicClassLoader classLoader = new DynamicClassLoader(conf, parent); String className = "TestLoadClassFromLocalPath";...
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJars) { return tryRefreshClass(name); } throw e...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } if (useDynamicJa...
@Test(timeout=60000) public void testSleepWithoutInterrupt() throws InterruptedException { Thread sleeper = new Thread(new Runnable() { @Override public void run() { LOG.debug("Sleeper thread: sleeping for " + SLEEP_TIME_MS); Threads.sleepWithoutInterrupt(SLEEP_TIME_MS); LOG.debug("Sleeper thread: finished sleeping"); ...
public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = System.currentTimeMillis(); long endTime = timeMillis + msToWait; boolean interrupted = false; while (timeMillis < endTime) { try { Thread.sleep(endTime - timeMillis); } catch (InterruptedException ex) { interrupted = true; } timeMillis =...
Threads { public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = System.currentTimeMillis(); long endTime = timeMillis + msToWait; boolean interrupted = false; while (timeMillis < endTime) { try { Thread.sleep(endTime - timeMillis); } catch (InterruptedException ex) { interrupted = true; } ti...
Threads { public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = System.currentTimeMillis(); long endTime = timeMillis + msToWait; boolean interrupted = false; while (timeMillis < endTime) { try { Thread.sleep(endTime - timeMillis); } catch (InterruptedException ex) { interrupted = true; } ti...
Threads { public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = System.currentTimeMillis(); long endTime = timeMillis + msToWait; boolean interrupted = false; while (timeMillis < endTime) { try { Thread.sleep(endTime - timeMillis); } catch (InterruptedException ex) { interrupted = true; } ti...
Threads { public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = System.currentTimeMillis(); long endTime = timeMillis + msToWait; boolean interrupted = false; while (timeMillis < endTime) { try { Thread.sleep(endTime - timeMillis); } catch (InterruptedException ex) { interrupted = true; } ti...
@Test(expected = IllegalArgumentException.class) public void testStringNoNullChars() { PositionedByteRange buff = new SimplePositionedMutableByteRange(3); OrderedBytes.encodeString(buff, "\u0000", Order.ASCENDING); }
public static int encodeString(PositionedByteRange dst, String val, Order ord) { if (null == val) { return encodeNull(dst, ord); } if (val.contains("\u0000")) throw new IllegalArgumentException("Cannot encode String values containing '\\u0000'"); final int offset = dst.getOffset(), start = dst.getPosition(); dst.put(TE...
OrderedBytes { public static int encodeString(PositionedByteRange dst, String val, Order ord) { if (null == val) { return encodeNull(dst, ord); } if (val.contains("\u0000")) throw new IllegalArgumentException("Cannot encode String values containing '\\u0000'"); final int offset = dst.getOffset(), start = dst.getPositio...
OrderedBytes { public static int encodeString(PositionedByteRange dst, String val, Order ord) { if (null == val) { return encodeNull(dst, ord); } if (val.contains("\u0000")) throw new IllegalArgumentException("Cannot encode String values containing '\\u0000'"); final int offset = dst.getOffset(), start = dst.getPositio...
OrderedBytes { public static int encodeString(PositionedByteRange dst, String val, Order ord) { if (null == val) { return encodeNull(dst, ord); } if (val.contains("\u0000")) throw new IllegalArgumentException("Cannot encode String values containing '\\u0000'"); final int offset = dst.getOffset(), start = dst.getPositio...
OrderedBytes { public static int encodeString(PositionedByteRange dst, String val, Order ord) { if (null == val) { return encodeNull(dst, ord); } if (val.contains("\u0000")) throw new IllegalArgumentException("Cannot encode String values containing '\\u0000'"); final int offset = dst.getOffset(), start = dst.getPositio...
@Test(expected = IllegalArgumentException.class) public void testBlobCopyNoZeroBytes() { byte[] val = { 0x01, 0x02, 0x00, 0x03 }; byte[] ascExpected = { 0x38, 0x01, 0x02, 0x00, 0x03 }; PositionedByteRange buf = new SimplePositionedMutableByteRange(val.length + 1); OrderedBytes.encodeBlobCopy(buf, val, Order.ASCENDING);...
public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, int voff, int vlen, Order ord) { if (null == val) { encodeNull(dst, ord); if (ASCENDING == ord) return 1; else { dst.put(ord.apply(TERM)); return 2; } } assert dst.getRemaining() >= vlen + (ASCENDING == ord ? 1 : 2); if (DESCENDING == ord) { for (int...
OrderedBytes { public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, int voff, int vlen, Order ord) { if (null == val) { encodeNull(dst, ord); if (ASCENDING == ord) return 1; else { dst.put(ord.apply(TERM)); return 2; } } assert dst.getRemaining() >= vlen + (ASCENDING == ord ? 1 : 2); if (DESCENDING == ...
OrderedBytes { public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, int voff, int vlen, Order ord) { if (null == val) { encodeNull(dst, ord); if (ASCENDING == ord) return 1; else { dst.put(ord.apply(TERM)); return 2; } } assert dst.getRemaining() >= vlen + (ASCENDING == ord ? 1 : 2); if (DESCENDING == ...
OrderedBytes { public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, int voff, int vlen, Order ord) { if (null == val) { encodeNull(dst, ord); if (ASCENDING == ord) return 1; else { dst.put(ord.apply(TERM)); return 2; } } assert dst.getRemaining() >= vlen + (ASCENDING == ord ? 1 : 2); if (DESCENDING == ...
OrderedBytes { public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, int voff, int vlen, Order ord) { if (null == val) { encodeNull(dst, ord); if (ASCENDING == ord) return 1; else { dst.put(ord.apply(TERM)); return 2; } } assert dst.getRemaining() >= vlen + (ASCENDING == ord ? 1 : 2); if (DESCENDING == ...
@Test public void testSkip() { BigDecimal longMax = BigDecimal.valueOf(Long.MAX_VALUE); double negInf = Double.NEGATIVE_INFINITY; BigDecimal negLarge = longMax.multiply(longMax).negate(); BigDecimal negMed = new BigDecimal("-10.0"); BigDecimal negSmall = new BigDecimal("-0.0010"); long zero = 0l; BigDecimal posSmall = ...
public static int skip(PositionedByteRange src) { final int start = src.getPosition(); byte header = src.get(); Order ord = (-1 == Integer.signum(header)) ? DESCENDING : ASCENDING; header = ord.apply(header); switch (header) { case NULL: case NEG_INF: return 1; case NEG_LARGE: skipVaruint64(src, DESCENDING != ord); ski...
OrderedBytes { public static int skip(PositionedByteRange src) { final int start = src.getPosition(); byte header = src.get(); Order ord = (-1 == Integer.signum(header)) ? DESCENDING : ASCENDING; header = ord.apply(header); switch (header) { case NULL: case NEG_INF: return 1; case NEG_LARGE: skipVaruint64(src, DESCENDI...
OrderedBytes { public static int skip(PositionedByteRange src) { final int start = src.getPosition(); byte header = src.get(); Order ord = (-1 == Integer.signum(header)) ? DESCENDING : ASCENDING; header = ord.apply(header); switch (header) { case NULL: case NEG_INF: return 1; case NEG_LARGE: skipVaruint64(src, DESCENDI...
OrderedBytes { public static int skip(PositionedByteRange src) { final int start = src.getPosition(); byte header = src.get(); Order ord = (-1 == Integer.signum(header)) ? DESCENDING : ASCENDING; header = ord.apply(header); switch (header) { case NULL: case NEG_INF: return 1; case NEG_LARGE: skipVaruint64(src, DESCENDI...
OrderedBytes { public static int skip(PositionedByteRange src) { final int start = src.getPosition(); byte header = src.get(); Order ord = (-1 == Integer.signum(header)) ? DESCENDING : ASCENDING; header = ord.apply(header); switch (header) { case NULL: case NEG_INF: return 1; case NEG_LARGE: skipVaruint64(src, DESCENDI...
@Test(timeout=180000) public void testFixAssignmentsWhenMETAinTransition() throws Exception { MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); admin.closeRegion(cluster.getServerHoldingMeta(), HRegionInfo.FIRST_META_REGIONINFO); regionStates.regionOffline(HRegionInfo.FIRST_META_REGIONINFO); new MetaTableLocator(...
private void closeRegion(HbckInfo hi) throws IOException, InterruptedException { if (hi.metaEntry == null && hi.hdfsEntry == null) { undeployRegions(hi); return; } Get get = new Get(hi.getRegionName()); get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); get.addColumn(HConstants.CATALOG_FAMILY, H...
HBaseFsck extends Configured implements Closeable { private void closeRegion(HbckInfo hi) throws IOException, InterruptedException { if (hi.metaEntry == null && hi.hdfsEntry == null) { undeployRegions(hi); return; } Get get = new Get(hi.getRegionName()); get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QU...
HBaseFsck extends Configured implements Closeable { private void closeRegion(HbckInfo hi) throws IOException, InterruptedException { if (hi.metaEntry == null && hi.hdfsEntry == null) { undeployRegions(hi); return; } Get get = new Get(hi.getRegionName()); get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QU...
HBaseFsck extends Configured implements Closeable { private void closeRegion(HbckInfo hi) throws IOException, InterruptedException { if (hi.metaEntry == null && hi.hdfsEntry == null) { undeployRegions(hi); return; } Get get = new Get(hi.getRegionName()); get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QU...
HBaseFsck extends Configured implements Closeable { private void closeRegion(HbckInfo hi) throws IOException, InterruptedException { if (hi.metaEntry == null && hi.hdfsEntry == null) { undeployRegions(hi); return; } Get get = new Get(hi.getRegionName()); get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QU...
@Test public void testEmpty(){ Assert.assertTrue(SimpleMutableByteRange.isEmpty(null)); ByteRange r = new SimpleMutableByteRange(); Assert.assertTrue(SimpleMutableByteRange.isEmpty(r)); Assert.assertTrue(r.isEmpty()); r.set(new byte[0]); Assert.assertEquals(0, r.getBytes().length); Assert.assertEquals(0, r.getOffset())...
@Override public boolean equals(Object thatObject) { if (thatObject == null) { return false; } if (this == thatObject) { return true; } if (hashCode() != thatObject.hashCode()) { return false; } if (!(thatObject instanceof SimpleMutableByteRange)) { return false; } SimpleMutableByteRange that = (SimpleMutableByteRange)...
SimpleMutableByteRange extends AbstractByteRange { @Override public boolean equals(Object thatObject) { if (thatObject == null) { return false; } if (this == thatObject) { return true; } if (hashCode() != thatObject.hashCode()) { return false; } if (!(thatObject instanceof SimpleMutableByteRange)) { return false; } Sim...
SimpleMutableByteRange extends AbstractByteRange { @Override public boolean equals(Object thatObject) { if (thatObject == null) { return false; } if (this == thatObject) { return true; } if (hashCode() != thatObject.hashCode()) { return false; } if (!(thatObject instanceof SimpleMutableByteRange)) { return false; } Sim...
SimpleMutableByteRange extends AbstractByteRange { @Override public boolean equals(Object thatObject) { if (thatObject == null) { return false; } if (this == thatObject) { return true; } if (hashCode() != thatObject.hashCode()) { return false; } if (!(thatObject instanceof SimpleMutableByteRange)) { return false; } Sim...
SimpleMutableByteRange extends AbstractByteRange { @Override public boolean equals(Object thatObject) { if (thatObject == null) { return false; } if (this == thatObject) { return true; } if (hashCode() != thatObject.hashCode()) { return false; } if (!(thatObject instanceof SimpleMutableByteRange)) { return false; } Sim...
@Test public void testKeys() { Object obj1 = pool.get("a"); Object obj2 = pool.get(new String("a")); Assert.assertSame(obj1, obj2); Object obj3 = pool.get("b"); Assert.assertNotSame(obj1, obj3); }
public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectReference existingRef...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
@Test(timeout=1000) public void testCongestion() throws Exception { final int THREAD_COUNT = 100; final AtomicBoolean assertionFailed = new AtomicBoolean(); final AtomicReference<Object> expectedObjRef = new AtomicReference<Object>(); final CountDownLatch prepareLatch = new CountDownLatch(THREAD_COUNT); final CountDown...
public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectReference existingRef...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
WeakObjectPool { public V get(K key) { ObjectReference ref = referenceCache.get(key); if (ref != null) { V obj = ref.get(); if (obj != null) { return obj; } referenceCache.remove(key, ref); } V newObj = objectFactory.createObject(key); ObjectReference newRef = new ObjectReference(key, newObj); while (true) { ObjectRefe...
@Test public void testAlternateRNG() throws Exception { Security.addProvider(new TestProvider()); Configuration conf = new Configuration(); conf.set(AES.RNG_ALGORITHM_KEY, "TestRNG"); conf.set(AES.RNG_PROVIDER_KEY, "TEST"); DefaultCipherProvider.getInstance().setConf(conf); AES aes = new AES(DefaultCipherProvider.getIn...
@VisibleForTesting SecureRandom getRNG() { return rng; }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); @Override String getName(); @Override int getKeyLength(); @Override int getIvLength(); @Override Key getRandomKey(); @Override Encryptor getEncryptor(); @Override Decryptor getDecryptor(); @Override OutputStream ...
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); @Override String getName(); @Override int getKeyLength(); @Override int getIvLength(); @Override Key getRandomKey(); @Override Encryptor getEncryptor(); @Override Decryptor getDecryptor(); @Override OutputStream ...
@Test public void testEquivalence() { ByteBuffer bb = ByteBuffer.allocate(1); this.reservoir.putBuffer(bb); this.reservoir.putBuffer(bb); this.reservoir.putBuffer(bb); assertEquals(3, this.reservoir.buffers.size()); }
public void putBuffer(ByteBuffer bb) { if (bb.capacity() > this.maxByteBufferSizeToCache) return; boolean success = false; int average = 0; lock.lock(); try { success = this.buffers.offer(bb); if (success) { this.totalReservoirCapacity += bb.capacity(); average = this.totalReservoirCapacity / this.buffers.size(); } } f...
BoundedByteBufferPool { public void putBuffer(ByteBuffer bb) { if (bb.capacity() > this.maxByteBufferSizeToCache) return; boolean success = false; int average = 0; lock.lock(); try { success = this.buffers.offer(bb); if (success) { this.totalReservoirCapacity += bb.capacity(); average = this.totalReservoirCapacity / th...
BoundedByteBufferPool { public void putBuffer(ByteBuffer bb) { if (bb.capacity() > this.maxByteBufferSizeToCache) return; boolean success = false; int average = 0; lock.lock(); try { success = this.buffers.offer(bb); if (success) { this.totalReservoirCapacity += bb.capacity(); average = this.totalReservoirCapacity / th...
BoundedByteBufferPool { public void putBuffer(ByteBuffer bb) { if (bb.capacity() > this.maxByteBufferSizeToCache) return; boolean success = false; int average = 0; lock.lock(); try { success = this.buffers.offer(bb); if (success) { this.totalReservoirCapacity += bb.capacity(); average = this.totalReservoirCapacity / th...
BoundedByteBufferPool { public void putBuffer(ByteBuffer bb) { if (bb.capacity() > this.maxByteBufferSizeToCache) return; boolean success = false; int average = 0; lock.lock(); try { success = this.buffers.offer(bb); if (success) { this.totalReservoirCapacity += bb.capacity(); average = this.totalReservoirCapacity / th...
@Test (timeout=20000) public void testCancelChore() throws InterruptedException { final int period = 100; ScheduledChore chore1 = new DoNothingChore("chore1", period); ChoreService service = ChoreService.getInstance("testCancelChore"); try { service.scheduleChore(chore1); assertTrue(chore1.isScheduled()); chore1.cancel...
@Override public synchronized void cancelChore(ScheduledChore chore) { cancelChore(chore, true); }
ChoreService implements ChoreServicer { @Override public synchronized void cancelChore(ScheduledChore chore) { cancelChore(chore, true); } }
ChoreService implements ChoreServicer { @Override public synchronized void cancelChore(ScheduledChore chore) { cancelChore(chore, true); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoo...
ChoreService implements ChoreServicer { @Override public synchronized void cancelChore(ScheduledChore chore) { cancelChore(chore, true); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoo...
ChoreService implements ChoreServicer { @Override public synchronized void cancelChore(ScheduledChore chore) { cancelChore(chore, true); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoo...
@Test (timeout=20000) public void testChoreServiceConstruction() throws InterruptedException { final int corePoolSize = 10; final int defaultCorePoolSize = ChoreService.MIN_CORE_POOL_SIZE; ChoreService customInit = new ChoreService("testChoreServiceConstruction_custom", corePoolSize, false); try { assertEquals(corePool...
int getCorePoolSize() { return scheduler.getCorePoolSize(); }
ChoreService implements ChoreServicer { int getCorePoolSize() { return scheduler.getCorePoolSize(); } }
ChoreService implements ChoreServicer { int getCorePoolSize() { return scheduler.getCorePoolSize(); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoolPrefix, int corePoolSize, boolean ji...
ChoreService implements ChoreServicer { int getCorePoolSize() { return scheduler.getCorePoolSize(); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoolPrefix, int corePoolSize, boolean ji...
ChoreService implements ChoreServicer { int getCorePoolSize() { return scheduler.getCorePoolSize(); } @VisibleForTesting ChoreService(final String coreThreadPoolPrefix); ChoreService(final String coreThreadPoolPrefix, final boolean jitter); ChoreService(final String coreThreadPoolPrefix, int corePoolSize, boolean ji...
@Test (timeout=180000) public void testHBaseFsckClean() throws Exception { assertNoErrors(doFsck(conf, false)); TableName table = TableName.valueOf("tableClean"); try { HBaseFsck hbck = doFsck(conf, false); assertNoErrors(hbck); setupTable(table); assertEquals(ROWKEYS.length, countRows()); hbck = doFsck(conf, false); a...
public Multimap<byte[], HbckInfo> getOverlapGroups( TableName table) { TableInfo ti = tablesInfo.get(table); return ti.overlapGroups; }
HBaseFsck extends Configured implements Closeable { public Multimap<byte[], HbckInfo> getOverlapGroups( TableName table) { TableInfo ti = tablesInfo.get(table); return ti.overlapGroups; } }
HBaseFsck extends Configured implements Closeable { public Multimap<byte[], HbckInfo> getOverlapGroups( TableName table) { TableInfo ti = tablesInfo.get(table); return ti.overlapGroups; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); }
HBaseFsck extends Configured implements Closeable { public Multimap<byte[], HbckInfo> getOverlapGroups( TableName table) { TableInfo ti = tablesInfo.get(table); return ti.overlapGroups; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair...
HBaseFsck extends Configured implements Closeable { public Multimap<byte[], HbckInfo> getOverlapGroups( TableName table) { TableInfo ti = tablesInfo.get(table); return ti.overlapGroups; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair...
@Test (timeout=20000) public void testShutdownCancelsScheduledChores() throws InterruptedException { final int period = 100; ChoreService service = new ChoreService("testShutdownCancelsScheduledChores"); ScheduledChore successChore1 = new DoNothingChore("sc1", period); ScheduledChore successChore2 = new DoNothingChore(...
public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledChores.put(chore, future); return true; }...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
@Test (timeout=20000) public void testShutdownRejectsNewSchedules() throws InterruptedException { final int period = 100; ChoreService service = new ChoreService("testShutdownRejectsNewSchedules"); ScheduledChore successChore1 = new DoNothingChore("sc1", period); ScheduledChore successChore2 = new DoNothingChore("sc2",...
public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledChores.put(chore, future); return true; }...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
ChoreService implements ChoreServicer { public synchronized boolean scheduleChore(ScheduledChore chore) { if (chore == null) { return false; } try { chore.setChoreServicer(this); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), chore.getTimeUnit()); scheduledC...
@Test public void testZKConfigLoading() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, 2181); Properties props = ZKConfig.makeZKProps(conf); assertEquals("Property client port should have been default from the HBase config", "2181", props.getProperty("...
public static Properties makeZKProps(Configuration conf) { Properties zkProperties = makeZKPropsFromZooCfg(conf); if (zkProperties == null) { zkProperties = makeZKPropsFromHbaseConfig(conf); } return zkProperties; }
ZKConfig { public static Properties makeZKProps(Configuration conf) { Properties zkProperties = makeZKPropsFromZooCfg(conf); if (zkProperties == null) { zkProperties = makeZKPropsFromHbaseConfig(conf); } return zkProperties; } }
ZKConfig { public static Properties makeZKProps(Configuration conf) { Properties zkProperties = makeZKPropsFromZooCfg(conf); if (zkProperties == null) { zkProperties = makeZKPropsFromHbaseConfig(conf); } return zkProperties; } private ZKConfig(); }
ZKConfig { public static Properties makeZKProps(Configuration conf) { Properties zkProperties = makeZKPropsFromZooCfg(conf); if (zkProperties == null) { zkProperties = makeZKPropsFromHbaseConfig(conf); } return zkProperties; } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Pr...
ZKConfig { public static Properties makeZKProps(Configuration conf) { Properties zkProperties = makeZKPropsFromZooCfg(conf); if (zkProperties == null) { zkProperties = makeZKPropsFromHbaseConfig(conf); } return zkProperties; } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Pr...
@Test public void testGetZooKeeperClusterKey() { Configuration conf = HBaseConfiguration.create(); conf.set(HConstants.ZOOKEEPER_QUORUM, "\tlocalhost\n"); conf.set(HConstants.ZOOKEEPER_CLIENT_PORT, "3333"); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "hbase"); String clusterKey = ZKConfig.getZooKeeperClusterKey(conf, "...
public static String getZooKeeperClusterKey(Configuration conf) { return getZooKeeperClusterKey(conf, null); }
ZKConfig { public static String getZooKeeperClusterKey(Configuration conf) { return getZooKeeperClusterKey(conf, null); } }
ZKConfig { public static String getZooKeeperClusterKey(Configuration conf) { return getZooKeeperClusterKey(conf, null); } private ZKConfig(); }
ZKConfig { public static String getZooKeeperClusterKey(Configuration conf) { return getZooKeeperClusterKey(conf, null); } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Properties parseZooCfg(Configuration conf, InputStream inputStream); static String getZKQuorumServers...
ZKConfig { public static String getZooKeeperClusterKey(Configuration conf) { return getZooKeeperClusterKey(conf, null); } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Properties parseZooCfg(Configuration conf, InputStream inputStream); static String getZKQuorumServers...
@Test public void testClusterKey() throws Exception { testKey("server", 2181, "hbase"); testKey("server1,server2,server3", 2181, "hbase"); try { ZKConfig.validateClusterKey("2181:hbase"); } catch (IOException ex) { } }
public static void validateClusterKey(String key) throws IOException { transformClusterKey(key); }
ZKConfig { public static void validateClusterKey(String key) throws IOException { transformClusterKey(key); } }
ZKConfig { public static void validateClusterKey(String key) throws IOException { transformClusterKey(key); } private ZKConfig(); }
ZKConfig { public static void validateClusterKey(String key) throws IOException { transformClusterKey(key); } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Properties parseZooCfg(Configuration conf, InputStream inputStream); static String getZKQuorumServersString(Confi...
ZKConfig { public static void validateClusterKey(String key) throws IOException { transformClusterKey(key); } private ZKConfig(); static Properties makeZKProps(Configuration conf); @Deprecated static Properties parseZooCfg(Configuration conf, InputStream inputStream); static String getZKQuorumServersString(Confi...
@Test public void testCreateCellScannerOverflow() throws IOException { consume(doCreateCellScanner(1, 1), 1 * 1); consume(doCreateCellScanner(3, 0), 3 * 0); consume(doCreateCellScanner(3, 3), 3 * 3); consume(doCreateCellScanner(0, 1), 0 * 1); final int hundredK = 100000; consume(doCreateCellScanner(hundredK, 0), hundre...
public static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables) { return new CellScanner() { private final Iterator<? extends CellScannable> iterator = cellScannerables.iterator(); private CellScanner cellScanner = null; @Override public Cell current() { return this.cellScanner != null...
CellUtil { public static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables) { return new CellScanner() { private final Iterator<? extends CellScannable> iterator = cellScannerables.iterator(); private CellScanner cellScanner = null; @Override public Cell current() { return this.cellScan...
CellUtil { public static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables) { return new CellScanner() { private final Iterator<? extends CellScannable> iterator = cellScannerables.iterator(); private CellScanner cellScanner = null; @Override public Cell current() { return this.cellScan...
CellUtil { public static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables) { return new CellScanner() { private final Iterator<? extends CellScannable> iterator = cellScannerables.iterator(); private CellScanner cellScanner = null; @Override public Cell current() { return this.cellScan...
CellUtil { public static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables) { return new CellScanner() { private final Iterator<? extends CellScannable> iterator = cellScannerables.iterator(); private CellScanner cellScanner = null; @Override public Cell current() { return this.cellScan...
@Test public void testOverlappingKeys() { byte[] empty = HConstants.EMPTY_BYTE_ARRAY; byte[] a = Bytes.toBytes("a"); byte[] b = Bytes.toBytes("b"); byte[] c = Bytes.toBytes("c"); byte[] d = Bytes.toBytes("d"); Assert.assertTrue(CellUtil.overlappingKeys(a, b, a, b)); Assert.assertTrue(CellUtil.overlappingKeys(a, c, a, b...
public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); } }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); } }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); } static ByteRange fi...
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); } static ByteRange fi...
@Test public void testFindCommonPrefixInFlatKey() { KeyValue kv1 = new KeyValue("r1".getBytes(), "f1".getBytes(), "q1".getBytes(), null); Assert.assertEquals(kv1.getKeyLength(), CellUtil.findCommonPrefixInFlatKey(kv1, kv1, true, true)); Assert.assertEquals(kv1.getKeyLength(), CellUtil.findCommonPrefixInFlatKey(kv1, kv1...
public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) { short rLen1 = c1.getRowLength(); short rLen2 = c2.getRowLength(); int commonPrefix = KeyValue.ROW_LENGTH_SIZE; if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.RO...
CellUtil { public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) { short rLen1 = c1.getRowLength(); short rLen2 = c2.getRowLength(); int commonPrefix = KeyValue.ROW_LENGTH_SIZE; if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, ...
CellUtil { public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) { short rLen1 = c1.getRowLength(); short rLen2 = c2.getRowLength(); int commonPrefix = KeyValue.ROW_LENGTH_SIZE; if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, ...
CellUtil { public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) { short rLen1 = c1.getRowLength(); short rLen2 = c2.getRowLength(); int commonPrefix = KeyValue.ROW_LENGTH_SIZE; if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, ...
CellUtil { public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) { short rLen1 = c1.getRowLength(); short rLen2 = c2.getRowLength(); int commonPrefix = KeyValue.ROW_LENGTH_SIZE; if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, ...
@Test public void testToString() { byte [] row = Bytes.toBytes("row"); long ts = 123l; KeyValue kv = new KeyValue(row, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYTE_ARRAY, ts, KeyValue.Type.Minimum, HConstants.EMPTY_BYTE_ARRAY); Cell cell = CellUtil.createCell(row, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYT...
public static String toString(Cell cell, boolean verbose) { if (cell == null) { return ""; } StringBuilder builder = new StringBuilder(); String keyStr = getCellKeyAsString(cell); String tag = null; String value = null; if (verbose) { tag = Bytes.toStringBinary(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLen...
CellUtil { public static String toString(Cell cell, boolean verbose) { if (cell == null) { return ""; } StringBuilder builder = new StringBuilder(); String keyStr = getCellKeyAsString(cell); String tag = null; String value = null; if (verbose) { tag = Bytes.toStringBinary(cell.getTagsArray(), cell.getTagsOffset(), cell...
CellUtil { public static String toString(Cell cell, boolean verbose) { if (cell == null) { return ""; } StringBuilder builder = new StringBuilder(); String keyStr = getCellKeyAsString(cell); String tag = null; String value = null; if (verbose) { tag = Bytes.toStringBinary(cell.getTagsArray(), cell.getTagsOffset(), cell...
CellUtil { public static String toString(Cell cell, boolean verbose) { if (cell == null) { return ""; } StringBuilder builder = new StringBuilder(); String keyStr = getCellKeyAsString(cell); String tag = null; String value = null; if (verbose) { tag = Bytes.toStringBinary(cell.getTagsArray(), cell.getTagsOffset(), cell...
CellUtil { public static String toString(Cell cell, boolean verbose) { if (cell == null) { return ""; } StringBuilder builder = new StringBuilder(); String keyStr = getCellKeyAsString(cell); String tag = null; String value = null; if (verbose) { tag = Bytes.toStringBinary(cell.getTagsArray(), cell.getTagsOffset(), cell...
@Test public void testEncodedLength() { PositionedByteRange buff = new SimplePositionedMutableByteRange(20); for (DataType<byte[]> type : new OrderedBlob[] { OrderedBlob.ASCENDING, OrderedBlob.DESCENDING }) { for (byte[] val : VALUES) { buff.setPosition(0); type.encode(buff, val); assertEquals( "encodedLength does not ...
@Override public int encodedLength(byte[] val) { return null == val ? (Order.ASCENDING == order ? 1 : 2) : (Order.ASCENDING == order ? val.length + 1 : val.length + 2); }
OrderedBlob extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? (Order.ASCENDING == order ? 1 : 2) : (Order.ASCENDING == order ? val.length + 1 : val.length + 2); } }
OrderedBlob extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? (Order.ASCENDING == order ? 1 : 2) : (Order.ASCENDING == order ? val.length + 1 : val.length + 2); } protected OrderedBlob(Order order); }
OrderedBlob extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? (Order.ASCENDING == order ? 1 : 2) : (Order.ASCENDING == order ? val.length + 1 : val.length + 2); } protected OrderedBlob(Order order); @Override boolean isSkippable(); @Override int encodedLength(byte...
OrderedBlob extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? (Order.ASCENDING == order ? 1 : 2) : (Order.ASCENDING == order ? val.length + 1 : val.length + 2); } protected OrderedBlob(Order order); @Override boolean isSkippable(); @Override int encodedLength(byte...
@Test (timeout=180000) public void testParallelHbck() throws Exception { final ExecutorService service; final Future<HBaseFsck> hbck1,hbck2; class RunHbck implements Callable<HBaseFsck>{ boolean fail = true; @Override public HBaseFsck call(){ Configuration c = new Configuration(conf); c.setInt("hbase.hbck.lockfile.atte...
public int getRetCode() { return retcode; }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair(); int onlineConsistencyRepair(); int onlineHbck(); static byte[] keyOnly(byte[] b); @Overr...
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair(); int onlineConsistencyRepair(); int onlineHbck(); static byte[] keyOnly(byte[] b); @Overr...
@Test public void testEncodedLength() { PositionedByteRange buff = new SimplePositionedMutableByteRange(20); for (DataType<String> type : new OrderedString[] { OrderedString.ASCENDING, OrderedString.DESCENDING }) { for (String val : VALUES) { buff.setPosition(0); type.encode(buff, val); assertEquals( "encodedLength doe...
@Override public int encodedLength(String val) { return null == val ? 1 : val.getBytes(OrderedBytes.UTF8).length + 2; }
OrderedString extends OrderedBytesBase<String> { @Override public int encodedLength(String val) { return null == val ? 1 : val.getBytes(OrderedBytes.UTF8).length + 2; } }
OrderedString extends OrderedBytesBase<String> { @Override public int encodedLength(String val) { return null == val ? 1 : val.getBytes(OrderedBytes.UTF8).length + 2; } protected OrderedString(Order order); }
OrderedString extends OrderedBytesBase<String> { @Override public int encodedLength(String val) { return null == val ? 1 : val.getBytes(OrderedBytes.UTF8).length + 2; } protected OrderedString(Order order); @Override int encodedLength(String val); @Override Class<String> encodedClass(); @Override String decode(Positio...
OrderedString extends OrderedBytesBase<String> { @Override public int encodedLength(String val) { return null == val ? 1 : val.getBytes(OrderedBytes.UTF8).length + 2; } protected OrderedString(Order order); @Override int encodedLength(String val); @Override Class<String> encodedClass(); @Override String decode(Positio...
@Test public void testEncodedLength() { PositionedByteRange buff = new SimplePositionedMutableByteRange(20); for (DataType<byte[]> type : new OrderedBlobVar[] { OrderedBlobVar.ASCENDING, OrderedBlobVar.DESCENDING }) { for (byte[] val : VALUES) { buff.setPosition(0); type.encode(buff, val); assertEquals( "encodedLength ...
@Override public int encodedLength(byte[] val) { return null == val ? 1 : OrderedBytes.blobVarEncodedLength(val.length); }
OrderedBlobVar extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? 1 : OrderedBytes.blobVarEncodedLength(val.length); } }
OrderedBlobVar extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? 1 : OrderedBytes.blobVarEncodedLength(val.length); } protected OrderedBlobVar(Order order); }
OrderedBlobVar extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? 1 : OrderedBytes.blobVarEncodedLength(val.length); } protected OrderedBlobVar(Order order); @Override int encodedLength(byte[] val); @Override Class<byte[]> encodedClass(); @Override byte[] decode(Po...
OrderedBlobVar extends OrderedBytesBase<byte[]> { @Override public int encodedLength(byte[] val) { return null == val ? 1 : OrderedBytes.blobVarEncodedLength(val.length); } protected OrderedBlobVar(Order order); @Override int encodedLength(byte[] val); @Override Class<byte[]> encodedClass(); @Override byte[] decode(Po...
@Test(expected = IllegalArgumentException.class) public void testEncodedValueContainsTerm() { DataType<byte[]> type = new TerminatedWrapper<byte[]>(new RawBytes(), "foo"); PositionedByteRange buff = new SimplePositionedMutableByteRange(16); type.encode(buff, Bytes.toBytes("hello foobar!")); }
@Override public int encode(PositionedByteRange dst, T val) { final int start = dst.getPosition(); int written = wrapped.encode(dst, val); PositionedByteRange b = dst.shallowCopy(); b.setLength(dst.getPosition()); b.setPosition(start); if (-1 != terminatorPosition(b)) { dst.setPosition(start); throw new IllegalArgument...
TerminatedWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { final int start = dst.getPosition(); int written = wrapped.encode(dst, val); PositionedByteRange b = dst.shallowCopy(); b.setLength(dst.getPosition()); b.setPosition(start); if (-1 != terminatorPosition(b)) { dst.se...
TerminatedWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { final int start = dst.getPosition(); int written = wrapped.encode(dst, val); PositionedByteRange b = dst.shallowCopy(); b.setLength(dst.getPosition()); b.setPosition(start); if (-1 != terminatorPosition(b)) { dst.se...
TerminatedWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { final int start = dst.getPosition(); int written = wrapped.encode(dst, val); PositionedByteRange b = dst.shallowCopy(); b.setLength(dst.getPosition()); b.setPosition(start); if (-1 != terminatorPosition(b)) { dst.se...
TerminatedWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { final int start = dst.getPosition(); int written = wrapped.encode(dst, val); PositionedByteRange b = dst.shallowCopy(); b.setLength(dst.getPosition()); b.setPosition(start); if (-1 != terminatorPosition(b)) { dst.se...
@Test(expected = IllegalArgumentException.class) public void testInvalidSkip() { PositionedByteRange buff = new SimplePositionedMutableByteRange(Bytes.toBytes("foo")); DataType<byte[]> type = new TerminatedWrapper<byte[]>(new RawBytes(), new byte[] { 0x00 }); type.skip(buff); }
@Override public int skip(PositionedByteRange src) { if (wrapped.isSkippable()) { int ret = wrapped.skip(src); src.setPosition(src.getPosition() + term.length); return ret + term.length; } else { final int start = src.getPosition(); int skipped = terminatorPosition(src); if (-1 == skipped) throw new IllegalArgumentExce...
TerminatedWrapper implements DataType<T> { @Override public int skip(PositionedByteRange src) { if (wrapped.isSkippable()) { int ret = wrapped.skip(src); src.setPosition(src.getPosition() + term.length); return ret + term.length; } else { final int start = src.getPosition(); int skipped = terminatorPosition(src); if (-...
TerminatedWrapper implements DataType<T> { @Override public int skip(PositionedByteRange src) { if (wrapped.isSkippable()) { int ret = wrapped.skip(src); src.setPosition(src.getPosition() + term.length); return ret + term.length; } else { final int start = src.getPosition(); int skipped = terminatorPosition(src); if (-...
TerminatedWrapper implements DataType<T> { @Override public int skip(PositionedByteRange src) { if (wrapped.isSkippable()) { int ret = wrapped.skip(src); src.setPosition(src.getPosition() + term.length); return ret + term.length; } else { final int start = src.getPosition(); int skipped = terminatorPosition(src); if (-...
TerminatedWrapper implements DataType<T> { @Override public int skip(PositionedByteRange src) { if (wrapped.isSkippable()) { int ret = wrapped.skip(src); src.setPosition(src.getPosition() + term.length); return ret + term.length; } else { final int start = src.getPosition(); int skipped = terminatorPosition(src); if (-...
@Test(expected = IllegalArgumentException.class) public void testInsufficientRemainingRead() { PositionedByteRange buff = new SimplePositionedMutableByteRange(0); DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(), 3); type.decode(buff); }
@Override public T decode(PositionedByteRange src) { if (src.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. src.offset: " + src.getOffset() + " src.length: " + src.getLength() + " src.position: " + src.getPosition() + " max length: " + length); } PositionedByteRange b = new ...
FixedLengthWrapper implements DataType<T> { @Override public T decode(PositionedByteRange src) { if (src.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. src.offset: " + src.getOffset() + " src.length: " + src.getLength() + " src.position: " + src.getPosition() + " max length:...
FixedLengthWrapper implements DataType<T> { @Override public T decode(PositionedByteRange src) { if (src.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. src.offset: " + src.getOffset() + " src.length: " + src.getLength() + " src.position: " + src.getPosition() + " max length:...
FixedLengthWrapper implements DataType<T> { @Override public T decode(PositionedByteRange src) { if (src.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. src.offset: " + src.getOffset() + " src.length: " + src.getLength() + " src.position: " + src.getPosition() + " max length:...
FixedLengthWrapper implements DataType<T> { @Override public T decode(PositionedByteRange src) { if (src.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. src.offset: " + src.getOffset() + " src.length: " + src.getLength() + " src.position: " + src.getPosition() + " max length:...
@Test(expected = IllegalArgumentException.class) public void testInsufficientRemainingWrite() { PositionedByteRange buff = new SimplePositionedMutableByteRange(0); DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(), 3); type.encode(buff, Bytes.toBytes("")); }
@Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " max length: " + length); } int written = base....
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
@Test(expected = IllegalArgumentException.class) public void testOverflowPassthrough() { PositionedByteRange buff = new SimplePositionedMutableByteRange(3); DataType<byte[]> type = new FixedLengthWrapper<byte[]>(new RawBytes(), 0); type.encode(buff, Bytes.toBytes("foo")); }
@Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " max length: " + length); } int written = base....
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
FixedLengthWrapper implements DataType<T> { @Override public int encode(PositionedByteRange dst, T val) { if (dst.getRemaining() < length) { throw new IllegalArgumentException("Not enough buffer remaining. dst.offset: " + dst.getOffset() + " dst.length: " + dst.getLength() + " dst.position: " + dst.getPosition() + " ma...
@Test public void testSubset() throws Exception { Configuration conf = HBaseConfiguration.create(); String prefix = "hbase.mapred.output."; conf.set("hbase.security.authentication", "kerberos"); conf.set("hbase.regionserver.kerberos.principal", "hbasesource"); HBaseConfiguration.setWithPrefix(conf, prefix, ImmutableMap...
public static Configuration subset(Configuration srcConf, String prefix) { Configuration newConf = new Configuration(false); for (Map.Entry<String, String> entry : srcConf) { if (entry.getKey().startsWith(prefix)) { String newKey = entry.getKey().substring(prefix.length()); if (!newKey.isEmpty()) { newConf.set(newKey, ...
HBaseConfiguration extends Configuration { public static Configuration subset(Configuration srcConf, String prefix) { Configuration newConf = new Configuration(false); for (Map.Entry<String, String> entry : srcConf) { if (entry.getKey().startsWith(prefix)) { String newKey = entry.getKey().substring(prefix.length()); if...
HBaseConfiguration extends Configuration { public static Configuration subset(Configuration srcConf, String prefix) { Configuration newConf = new Configuration(false); for (Map.Entry<String, String> entry : srcConf) { if (entry.getKey().startsWith(prefix)) { String newKey = entry.getKey().substring(prefix.length()); if...
HBaseConfiguration extends Configuration { public static Configuration subset(Configuration srcConf, String prefix) { Configuration newConf = new Configuration(false); for (Map.Entry<String, String> entry : srcConf) { if (entry.getKey().startsWith(prefix)) { String newKey = entry.getKey().substring(prefix.length()); if...
HBaseConfiguration extends Configuration { public static Configuration subset(Configuration srcConf, String prefix) { Configuration newConf = new Configuration(false); for (Map.Entry<String, String> entry : srcConf) { if (entry.getKey().startsWith(prefix)) { String newKey = entry.getKey().substring(prefix.length()); if...
@Test public void testGetPassword() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.set(ReflectiveCredentialProviderClient.CREDENTIAL_PROVIDER_PATH, "jceks: + new File(UTIL.getDataTestDir().toUri().getPath(), "foo.jks").getCanonicalPath()); ReflectiveCredentialProviderClient client = new Refle...
public static String getPassword(Configuration conf, String alias, String defPass) throws IOException { String passwd = null; try { Method m = Configuration.class.getMethod("getPassword", String.class); char[] p = (char[]) m.invoke(conf, alias); if (p != null) { LOG.debug(String.format("Config option \"%s\" was found t...
HBaseConfiguration extends Configuration { public static String getPassword(Configuration conf, String alias, String defPass) throws IOException { String passwd = null; try { Method m = Configuration.class.getMethod("getPassword", String.class); char[] p = (char[]) m.invoke(conf, alias); if (p != null) { LOG.debug(Stri...
HBaseConfiguration extends Configuration { public static String getPassword(Configuration conf, String alias, String defPass) throws IOException { String passwd = null; try { Method m = Configuration.class.getMethod("getPassword", String.class); char[] p = (char[]) m.invoke(conf, alias); if (p != null) { LOG.debug(Stri...
HBaseConfiguration extends Configuration { public static String getPassword(Configuration conf, String alias, String defPass) throws IOException { String passwd = null; try { Method m = Configuration.class.getMethod("getPassword", String.class); char[] p = (char[]) m.invoke(conf, alias); if (p != null) { LOG.debug(Stri...
HBaseConfiguration extends Configuration { public static String getPassword(Configuration conf, String alias, String defPass) throws IOException { String passwd = null; try { Method m = Configuration.class.getMethod("getPassword", String.class); char[] p = (char[]) m.invoke(conf, alias); if (p != null) { LOG.debug(Stri...
@Test public void testTimeoutBlockingQueue() { TimeoutBlockingQueue<TestObject> queue; int[][] testArray = new int[][] { {200, 400, 600}, {200, 400, 100}, {200, 400, 300}, }; for (int i = 0; i < testArray.length; ++i) { int[] sortedArray = Arrays.copyOf(testArray[i], testArray[i].length); Arrays.sort(sortedArray); queu...
public TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever) { this(32, timeoutRetriever); }
TimeoutBlockingQueue { public TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever) { this(32, timeoutRetriever); } }
TimeoutBlockingQueue { public TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever) { this(32, timeoutRetriever); } TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever); @SuppressWarnings("unchecked") TimeoutBlockingQueue(int capacity, TimeoutRetriever<? super E> timeoutRetriever); }
TimeoutBlockingQueue { public TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever) { this(32, timeoutRetriever); } TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever); @SuppressWarnings("unchecked") TimeoutBlockingQueue(int capacity, TimeoutRetriever<? super E> timeoutRetriever); void dump...
TimeoutBlockingQueue { public TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever) { this(32, timeoutRetriever); } TimeoutBlockingQueue(TimeoutRetriever<? super E> timeoutRetriever); @SuppressWarnings("unchecked") TimeoutBlockingQueue(int capacity, TimeoutRetriever<? super E> timeoutRetriever); void dump...
@Test (timeout=180000) public void testParallelWithRetriesHbck() throws Exception { final ExecutorService service; final Future<HBaseFsck> hbck1,hbck2; final int timeoutInSeconds = 80; final int sleepIntervalInMilliseconds = 200; final int maxSleepTimeInMilliseconds = 6000; final int maxRetryAttempts = 15; class RunHbc...
public int getRetCode() { return retcode; }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); }
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair(); int onlineConsistencyRepair(); int onlineHbck(); static byte[] keyOnly(byte[] b); @Overr...
HBaseFsck extends Configured implements Closeable { public int getRetCode() { return retcode; } HBaseFsck(Configuration conf); HBaseFsck(Configuration conf, ExecutorService exec); void connect(); void offlineHdfsIntegrityRepair(); int onlineConsistencyRepair(); int onlineHbck(); static byte[] keyOnly(byte[] b); @Overr...
@Test public void testIsTracking() { long[][] procIds = new long[][] {{4, 7}, {1024, 1027}, {8192, 8194}}; long[][] checkIds = new long[][] {{2, 8}, {1023, 1025}, {8193, 8191}}; ProcedureStoreTracker tracker = new ProcedureStoreTracker(); for (int i = 0; i < procIds.length; ++i) { long[] seq = procIds[i]; tracker.inser...
public boolean isTracking(long minId, long maxId) { return map.floorEntry(minId) != null || map.floorEntry(maxId) != null; }
ProcedureStoreTracker { public boolean isTracking(long minId, long maxId) { return map.floorEntry(minId) != null || map.floorEntry(maxId) != null; } }
ProcedureStoreTracker { public boolean isTracking(long minId, long maxId) { return map.floorEntry(minId) != null || map.floorEntry(maxId) != null; } }
ProcedureStoreTracker { public boolean isTracking(long minId, long maxId) { return map.floorEntry(minId) != null || map.floorEntry(maxId) != null; } void insert(long procId); void insert(final long procId, final long[] subProcIds); void update(long procId); void delete(long procId); long getUpdatedMinProcId(); long ge...
ProcedureStoreTracker { public boolean isTracking(long minId, long maxId) { return map.floorEntry(minId) != null || map.floorEntry(maxId) != null; } void insert(long procId); void insert(final long procId, final long[] subProcIds); void update(long procId); void delete(long procId); long getUpdatedMinProcId(); long ge...
@Test public void testDelete() { final ProcedureStoreTracker tracker = new ProcedureStoreTracker(); long[] procIds = new long[] { 65, 1, 193 }; for (int i = 0; i < procIds.length; ++i) { tracker.insert(procIds[i]); tracker.dump(); } for (int i = 0; i < (64 * 4); ++i) { boolean hasProc = false; for (int j = 0; j < procI...
public void delete(long procId) { Map.Entry<Long, BitSetNode> entry = map.floorEntry(procId); assert entry != null : "expected node to delete procId=" + procId; BitSetNode node = entry.getValue(); assert node.contains(procId) : "expected procId in the node"; node.delete(procId); if (!keepDeletes && node.isEmpty()) { ma...
ProcedureStoreTracker { public void delete(long procId) { Map.Entry<Long, BitSetNode> entry = map.floorEntry(procId); assert entry != null : "expected node to delete procId=" + procId; BitSetNode node = entry.getValue(); assert node.contains(procId) : "expected procId in the node"; node.delete(procId); if (!keepDeletes...
ProcedureStoreTracker { public void delete(long procId) { Map.Entry<Long, BitSetNode> entry = map.floorEntry(procId); assert entry != null : "expected node to delete procId=" + procId; BitSetNode node = entry.getValue(); assert node.contains(procId) : "expected procId in the node"; node.delete(procId); if (!keepDeletes...
ProcedureStoreTracker { public void delete(long procId) { Map.Entry<Long, BitSetNode> entry = map.floorEntry(procId); assert entry != null : "expected node to delete procId=" + procId; BitSetNode node = entry.getValue(); assert node.contains(procId) : "expected procId in the node"; node.delete(procId); if (!keepDeletes...
ProcedureStoreTracker { public void delete(long procId) { Map.Entry<Long, BitSetNode> entry = map.floorEntry(procId); assert entry != null : "expected node to delete procId=" + procId; BitSetNode node = entry.getValue(); assert node.contains(procId) : "expected procId in the node"; node.delete(procId); if (!keepDeletes...
@Test public void testEmptyRoll() throws Exception { for (int i = 0; i < 10; ++i) { procStore.periodicRollForTesting(); } FileStatus[] status = fs.listStatus(logDir); assertEquals(1, status.length); }
@VisibleForTesting protected void periodicRollForTesting() throws IOException { lock.lock(); try { periodicRoll(); } finally { lock.unlock(); } }
WALProcedureStore extends ProcedureStoreBase { @VisibleForTesting protected void periodicRollForTesting() throws IOException { lock.lock(); try { periodicRoll(); } finally { lock.unlock(); } } }
WALProcedureStore extends ProcedureStoreBase { @VisibleForTesting protected void periodicRollForTesting() throws IOException { lock.lock(); try { periodicRoll(); } finally { lock.unlock(); } } WALProcedureStore(final Configuration conf, final FileSystem fs, final Path logDir, final LeaseRecovery leaseRecovery); }
WALProcedureStore extends ProcedureStoreBase { @VisibleForTesting protected void periodicRollForTesting() throws IOException { lock.lock(); try { periodicRoll(); } finally { lock.unlock(); } } WALProcedureStore(final Configuration conf, final FileSystem fs, final Path logDir, final LeaseRecovery leaseRecovery); @...
WALProcedureStore extends ProcedureStoreBase { @VisibleForTesting protected void periodicRollForTesting() throws IOException { lock.lock(); try { periodicRoll(); } finally { lock.unlock(); } } WALProcedureStore(final Configuration conf, final FileSystem fs, final Path logDir, final LeaseRecovery leaseRecovery); @...
@Test public void testLoad() throws Exception { Set<Long> procIds = new HashSet<>(); Procedure proc1 = new TestSequentialProcedure(); procIds.add(proc1.getProcId()); procStore.insert(proc1, null); Procedure proc2 = new TestSequentialProcedure(); Procedure[] child2 = new Procedure[2]; child2[0] = new TestSequentialProce...
@Override public void load(final ProcedureLoader loader) throws IOException { if (logs.isEmpty()) { throw new RuntimeException("recoverLease() must be called before loading data"); } if (logs.size() == 1) { if (LOG.isDebugEnabled()) { LOG.debug("No state logs to replay."); } loader.setMaxProcId(0); loading.set(false); ...
WALProcedureStore extends ProcedureStoreBase { @Override public void load(final ProcedureLoader loader) throws IOException { if (logs.isEmpty()) { throw new RuntimeException("recoverLease() must be called before loading data"); } if (logs.size() == 1) { if (LOG.isDebugEnabled()) { LOG.debug("No state logs to replay.");...
WALProcedureStore extends ProcedureStoreBase { @Override public void load(final ProcedureLoader loader) throws IOException { if (logs.isEmpty()) { throw new RuntimeException("recoverLease() must be called before loading data"); } if (logs.size() == 1) { if (LOG.isDebugEnabled()) { LOG.debug("No state logs to replay.");...
WALProcedureStore extends ProcedureStoreBase { @Override public void load(final ProcedureLoader loader) throws IOException { if (logs.isEmpty()) { throw new RuntimeException("recoverLease() must be called before loading data"); } if (logs.size() == 1) { if (LOG.isDebugEnabled()) { LOG.debug("No state logs to replay.");...
WALProcedureStore extends ProcedureStoreBase { @Override public void load(final ProcedureLoader loader) throws IOException { if (logs.isEmpty()) { throw new RuntimeException("recoverLease() must be called before loading data"); } if (logs.size() == 1) { if (LOG.isDebugEnabled()) { LOG.debug("No state logs to replay.");...