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 errorMessageHelperDoesNotConsumeErrorBody() throws IOException { ResponseBody errorBody = ResponseBody.create(null, "This request failed."); BufferedSource source = errorBody.source(); assertThat(LoggingCallAdapterFactory.errorMessage(errorBody)).isEqualTo("This request failed."); assertThat(source.ge...
public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain text."; } return ResponseBody.create(errorBody.contentTy...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
@Test public void executeDoesNotLogRequestCreationFailureFatal() throws IOException { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFacto...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void delegatesCallAdapter() { MockWebServer server = new MockWebServer(); AtomicBoolean delegateAdaptCalled = new AtomicBoolean(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallAdapterFactory.Logger() { @Override pub...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void errorMessageHelperReturnsEmptyStringForEmptyBody() throws IOException { ResponseBody errorBody = ResponseBody.create(null, new byte[0]); assertThat(LoggingCallAdapterFactory.errorMessage(errorBody)).isEmpty(); }
public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain text."; } return ResponseBody.create(errorBody.contentTy...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
@Test public void errorMessageHelperChecksForPlainText() throws IOException { ResponseBody errorBody = ResponseBody.create(null, String.valueOf((char) 0x9F)); assertThat(LoggingCallAdapterFactory.errorMessage(errorBody)) .isEqualTo("Error body is not plain text."); }
public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain text."; } return ResponseBody.create(errorBody.contentTy...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body is not plain ...
@Test public void executeLogsOnResponse() throws Exception { MockWebServer server = new MockWebServer(); final AtomicBoolean onResponseCalled = new AtomicBoolean(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallAdapterFactory.Log...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void executeLogsOnFailure() throws Exception { MockWebServer server = new MockWebServer(); final AtomicBoolean onFailureCalled = new AtomicBoolean(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallAdapterFactory.Logge...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void executeLogsOnFailureExceptions() throws Exception { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCa...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void executeDoesNotLogOnFailureExceptionsFatal() throws Exception { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(ne...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void enqueueLogsRequestCreationFailure() { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallAdapterFacto...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void executeLogsRequestCreationFailure() throws IOException { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new Logg...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void enqueueDoesNotLogRequestCreationFailureFatal() { MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallA...
@Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } }
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } LoggingCallAdapterFact...
@Test public void testToString() { ServerName hsa1 = new ServerName("localhost", 1234, -1L); HRegionLocation hrl1 = new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa1.getHostname(), hsa1.getPort()); System.out.println(hrl1.toString()); }
@Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; }
HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } }
HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } HRegionLocation(HRegi...
HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } HRegionLocation(HRegi...
HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } HRegionLocation(HRegi...
@Test public void testJobConfiguration() throws Exception { Job job = new Job(); HTable table = Mockito.mock(HTable.class); setupMockStartKeys(table); HFileOutputFormat.configureIncrementalLoad(job, table); assertEquals(job.getNumReduceTasks(), 4); }
public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } catch (ClassNotFoundException e) { throw new IOException("Failed getting TotalOrderPartitioner",...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } catch (ClassNotFo...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } catch (ClassNotFo...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } catch (ClassNotFo...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } catch (ClassNotFo...
@Test public void testCreateFamilyCompressionMap() throws IOException { for (int numCfs = 0; numCfs <= 3; numCfs++) { Configuration conf = new Configuration(this.util.getConfiguration()); Map<String, Compression.Algorithm> familyToCompression = getMockColumnFamilies(numCfs); HTable table = Mockito.mock(HTable.class); s...
static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); }
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); } }
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); } }
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); } RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context); sta...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); } RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context); sta...
@Test public void testBatchSink() throws Exception { HLog.Entry[] entries = new HLog.Entry[BATCH_SIZE]; for(int i = 0; i < BATCH_SIZE; i++) { entries[i] = createEntry(TABLE_NAME1, i, KeyValue.Type.Put); } SINK.replicateEntries(entries); Scan scan = new Scan(); ResultScanner scanRes = table1.getScanner(scan); assertEqua...
public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] table = entry.getKe...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
@Test public void testMixedPutDelete() throws Exception { HLog.Entry[] entries = new HLog.Entry[BATCH_SIZE/2]; for(int i = 0; i < BATCH_SIZE/2; i++) { entries[i] = createEntry(TABLE_NAME1, i, KeyValue.Type.Put); } SINK.replicateEntries(entries); entries = new HLog.Entry[BATCH_SIZE]; for(int i = 0; i < BATCH_SIZE; i++) ...
public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] table = entry.getKe...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
@Test public void testMixedPutTables() throws Exception { HLog.Entry[] entries = new HLog.Entry[BATCH_SIZE]; for(int i = 0; i < BATCH_SIZE; i++) { entries[i] = createEntry( i % 2 == 0 ? TABLE_NAME2 : TABLE_NAME1, i, KeyValue.Type.Put); } SINK.replicateEntries(entries); Scan scan = new Scan(); ResultScanner scanRes = ta...
public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] table = entry.getKe...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
@Test public void testMixedDeletes() throws Exception { HLog.Entry[] entries = new HLog.Entry[3]; for(int i = 0; i < 3; i++) { entries[i] = createEntry(TABLE_NAME1, i, KeyValue.Type.Put); } SINK.replicateEntries(entries); entries = new HLog.Entry[3]; entries[0] = createEntry(TABLE_NAME1, 0, KeyValue.Type.DeleteColumn);...
public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] table = entry.getKe...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
@Test public void testApplyDeleteBeforePut() throws Exception { HLog.Entry[] entries = new HLog.Entry[5]; for(int i = 0; i < 2; i++) { entries[i] = createEntry(TABLE_NAME1, i, KeyValue.Type.Put); } entries[2] = createEntry(TABLE_NAME1, 1, KeyValue.Type.DeleteFamily); for(int i = 3; i < 5; i++) { entries[i] = createEntr...
public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] table = entry.getKe...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } try { long totalReplicated = 0; Map<byte[], List<Row>> rows = new TreeMap<byte[], List<Row>>(Bytes.BYTES_COMPARATOR); for (HLog.Entry entry : entries) { WALEdit edit = entry.getEdit(); byte[] t...
@Test public void testGetAttributes() { Get get = new Get(); Assert.assertTrue(get.getAttributesMap().isEmpty()); Assert.assertNull(get.getAttribute("absent")); get.setAttribute("absent", null); Assert.assertTrue(get.getAttributesMap().isEmpty()); Assert.assertNull(get.getAttribute("absent")); get.setAttribute("attribu...
public Get() {}
Get extends OperationWithAttributes implements Writable, Row, Comparable<Row> { public Get() {} }
Get extends OperationWithAttributes implements Writable, Row, Comparable<Row> { public Get() {} Get(); Get(byte [] row); Get(byte [] row, RowLock rowLock); }
Get extends OperationWithAttributes implements Writable, Row, Comparable<Row> { public Get() {} Get(); Get(byte [] row); Get(byte [] row, RowLock rowLock); Get addFamily(byte [] family); Get addColumn(byte [] family, byte [] qualifier); Get setTimeRange(long minStamp, long maxStamp); Get setTimeStamp(long timestamp);...
Get extends OperationWithAttributes implements Writable, Row, Comparable<Row> { public Get() {} Get(); Get(byte [] row); Get(byte [] row, RowLock rowLock); Get addFamily(byte [] family); Get addColumn(byte [] family, byte [] qualifier); Get setTimeRange(long minStamp, long maxStamp); Get setTimeStamp(long timestamp);...
@Test public void testBucketPut() throws Exception { byte [] TABLE = Bytes.toBytes("testBucketPut"); HTable ht = TEST_UTIL.createTable(TABLE, FAMILY); ht.setAutoFlush( false ); List<Put> puts = new ArrayList<Put>(); puts.add( createPut("row1") ); puts.add( createPut("row2") ); puts.add( createPut("row3") ); puts.add( c...
public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); }
HTableUtil { public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); } }
HTableUtil { public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); } }
HTableUtil { public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); } static void bucketRsPut(HTable htable, List<Put> puts); static void bu...
HTableUtil { public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); } static void bucketRsPut(HTable htable, List<Put> puts); static void bu...
@Test public void testBucketBatch() throws Exception { byte [] TABLE = Bytes.toBytes("testBucketBatch"); HTable ht = TEST_UTIL.createTable(TABLE, FAMILY); List<Row> rows = new ArrayList<Row>(); rows.add( createPut("row1") ); rows.add( createPut("row2") ); rows.add( createPut("row3") ); rows.add( createPut("row4") ); HT...
public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } }
HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } } }
HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } } }
HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } } static void bucketRs...
HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } } static void bucketRs...
@Test public void testMultiCellGetJSON() throws IOException, JAXBException { String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1; String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2; StringBuilder path = new StringBuilder(); path.append("/"); path.append(TABLE); path.append("/multiget/?row="); path....
@GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model = new CellSetModel(); for (String rk : ...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
@Test public void testOperationJSON() throws IOException { Scan scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); String json = scan.toJSON(); Map<String, Object> parsedJSON = mapper.readValue(json, HashMap.class); assertEquals("startRow incorrect in Scan.toJSON()", Bytes.toStringBinary(ROW), parsedJSON.get("sta...
public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); }
Operation { public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); } }
Operation { public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); } }
Operation { public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); } abstract Map<String, Object> getFingerprint(); abstract Map<String, Object> toMap(int maxCols); Map<String, Object> toMap(); String toJSON(int maxCols); Strin...
Operation { public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); } abstract Map<String, Object> getFingerprint(); abstract Map<String, Object> toMap(int maxCols); Map<String, Object> toMap(); String toJSON(int maxCols); Strin...
@Test public void testMetaScanner() throws Exception { LOG.info("Starting testMetaScanner"); final byte[] TABLENAME = Bytes.toBytes("testMetaScanner"); final byte[] FAMILY = Bytes.toBytes("family"); TEST_UTIL.createTable(TABLENAME, FAMILY); Configuration conf = TEST_UTIL.getConfiguration(); HTable table = new HTable(co...
public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); }
MetaScanner { public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); } }
MetaScanner { public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); } }
MetaScanner { public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); } static void metaScan(Configuration configuration, MetaScannerVisitor visitor); static void metaScan(Configuration configuration, MetaScannerVisit...
MetaScanner { public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); } static void metaScan(Configuration configuration, MetaScannerVisitor visitor); static void metaScan(Configuration configuration, MetaScannerVisit...
@Test public void testRetryTimeJitter() { long[] retries = new long[200]; long baseTime = 1000000; long maxTimeExpected = (long) (baseTime * 1.01f); for (int i = 0; i < retries.length; i++) { retries[i] = ConnectionUtils.getPauseTime(baseTime, 0); } Set<Long> retyTimeSet = new TreeSet<Long>(); for (long l : retries) { ...
public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM.nextFloat() * 0.01f); return no...
ConnectionUtils { public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM.nextFloat() *...
ConnectionUtils { public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM.nextFloat() *...
ConnectionUtils { public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM.nextFloat() *...
ConnectionUtils { public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM.nextFloat() *...
@Test public void test() { Configuration c = HBaseConfiguration.create(); assertEquals("localhost:" + c.get(HConstants.ZOOKEEPER_CLIENT_PORT), parser.parse(c)); final String port = "1234"; c.set(HConstants.ZOOKEEPER_CLIENT_PORT, port); c.set("hbase.zookeeper.quorum", "example.com"); assertEquals("example.com:" + port, ...
public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().trim(); String value = entry.getValue().to...
ZooKeeperMainServerArg { public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().trim(); String va...
ZooKeeperMainServerArg { public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().trim(); String va...
ZooKeeperMainServerArg { public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().trim(); String va...
ZooKeeperMainServerArg { public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().trim(); String va...
@Test public void testConfigInjection() throws Exception { String s = "dataDir=" + this.dataDir.toString() + "\n" + "clientPort=2181\n" + "initLimit=2\n" + "syncLimit=2\n" + "server.0=${hbase.master.hostname}:2888:3888\n" + "server.1=server1:2888:3888\n" + "server.2=server2:2888:3888\n"; System.setProperty("hbase.maste...
static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); String myAddress = Strings.domainNamePointerToHostName(DNS.getDefaultHost( conf.get("hbase.zookeeper.dns.interface","default"), conf.get("hbase.zookeeper.dns.nameserver","default"))); List...
HQuorumPeer { static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); String myAddress = Strings.domainNamePointerToHostName(DNS.getDefaultHost( conf.get("hbase.zookeeper.dns.interface","default"), conf.get("hbase.zookeeper.dns.nameserver","def...
HQuorumPeer { static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); String myAddress = Strings.domainNamePointerToHostName(DNS.getDefaultHost( conf.get("hbase.zookeeper.dns.interface","default"), conf.get("hbase.zookeeper.dns.nameserver","def...
HQuorumPeer { static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); String myAddress = Strings.domainNamePointerToHostName(DNS.getDefaultHost( conf.get("hbase.zookeeper.dns.interface","default"), conf.get("hbase.zookeeper.dns.nameserver","def...
HQuorumPeer { static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); String myAddress = Strings.domainNamePointerToHostName(DNS.getDefaultHost( conf.get("hbase.zookeeper.dns.interface","default"), conf.get("hbase.zookeeper.dns.nameserver","def...
@Test public void testRestartMaster() throws IOException, KeeperException { ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(), "testActiveMasterManagerFromZK", null, true); try { ZKUtil.deleteNode(zk, zk.masterAddressZNode); ZKUtil.deleteNode(zk, zk.clusterStateZNode); } catch(KeeperException.NoNo...
boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.backupMasterAddressesZNode, this.sn.toString()); if (ZKUtil.crea...
ActiveMasterManager extends ZooKeeperListener { boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.backupMasterAddr...
ActiveMasterManager extends ZooKeeperListener { boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.backupMasterAddr...
ActiveMasterManager extends ZooKeeperListener { boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.backupMasterAddr...
ActiveMasterManager extends ZooKeeperListener { boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.backupMasterAddr...
@Test(timeout = 5000) public void testBalanceOnMasterFailoverScenarioWithOpenedNode() throws IOException, KeeperException, InterruptedException { AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(this.server, this.serverManager); try { createRegionPlanAndBalance(am, SERVERNAME_A, SERVERNAME_B, REG...
public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
@Test(timeout = 5000) public void testBalanceOnMasterFailoverScenarioWithClosedNode() throws IOException, KeeperException, InterruptedException { AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(this.server, this.serverManager); try { createRegionPlanAndBalance(am, SERVERNAME_A, SERVERNAME_B, REG...
public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
@Test(timeout = 5000) public void testBalanceOnMasterFailoverScenarioWithOfflineNode() throws IOException, KeeperException, InterruptedException { AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(this.server, this.serverManager); try { createRegionPlanAndBalance(am, SERVERNAME_A, SERVERNAME_B, RE...
public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
@Test(timeout = 10000) public void testBalance() throws IOException, KeeperException, InterruptedException { ExecutorService executor = startupMasterExecutor("testBalanceExecutor"); CatalogTracker ct = Mockito.mock(CatalogTracker.class); LoadBalancer balancer = LoadBalancerFactory.getLoadBalancer(server .getConfigurati...
void balance(final RegionPlan plan) { synchronized (this.regionPlans) { this.regionPlans.put(plan.getRegionName(), plan); } unassign(plan.getRegionInfo()); }
AssignmentManager extends ZooKeeperListener { void balance(final RegionPlan plan) { synchronized (this.regionPlans) { this.regionPlans.put(plan.getRegionName(), plan); } unassign(plan.getRegionInfo()); } }
AssignmentManager extends ZooKeeperListener { void balance(final RegionPlan plan) { synchronized (this.regionPlans) { this.regionPlans.put(plan.getRegionName(), plan); } unassign(plan.getRegionInfo()); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
AssignmentManager extends ZooKeeperListener { void balance(final RegionPlan plan) { synchronized (this.regionPlans) { this.regionPlans.put(plan.getRegionName(), plan); } unassign(plan.getRegionInfo()); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
AssignmentManager extends ZooKeeperListener { void balance(final RegionPlan plan) { synchronized (this.regionPlans) { this.regionPlans.put(plan.getRegionName(), plan); } unassign(plan.getRegionInfo()); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
@Test public void testMultiCellGetXML() throws IOException, JAXBException { String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1; String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2; StringBuilder path = new StringBuilder(); path.append("/"); path.append(TABLE); path.append("/multiget/?row="); path.a...
@GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model = new CellSetModel(); for (String rk : ...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
@Test public void testShutdownHandler() throws KeeperException, IOException { ExecutorService executor = startupMasterExecutor("testShutdownHandler"); CatalogTracker ct = Mockito.mock(CatalogTracker.class); LoadBalancer balancer = LoadBalancerFactory.getLoadBalancer(server .getConfiguration()); AssignmentManager am = n...
public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } }
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
AssignmentManager extends ZooKeeperListener { public void shutdown() { if (null != threadPoolExecutorService) { this.threadPoolExecutorService.shutdown(); } } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalancer balancer, final ExecutorService servi...
@Test(timeout = 5000) public void testProcessDeadServersAndRegionsInTransitionShouldNotFailWithNPE() throws IOException, KeeperException, InterruptedException, ServiceException { final RecoverableZooKeeper recoverableZk = Mockito .mock(RecoverableZooKeeper.class); AssignmentManagerWithExtrasForTesting am = setUpMockedA...
void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); }
AssignmentManager extends ZooKeeperListener { void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); } }
AssignmentManager extends ZooKeeperListener { void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
AssignmentManager extends ZooKeeperListener { void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
AssignmentManager extends ZooKeeperListener { void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, final LoadBalance...
@Test public void deleteColumnFamilyWithMultipleRegions() throws Exception { HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); HTableDescriptor beforehtd = admin.getTableDescriptor(Bytes .toBytes(TABLENAME)); FileSystem fs = TEST_UTIL.getDFSCluster().getFileSystem(); assertTrue(admin.isTableAvailable(TABLENAME)); assertEqu...
@Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(familyName); } return getClass().getSimpleName() + "-" + name + "-"...
TableDeleteFamilyHandler extends TableEventHandler { @Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(familyName); }...
TableDeleteFamilyHandler extends TableEventHandler { @Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(familyName); }...
TableDeleteFamilyHandler extends TableEventHandler { @Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(familyName); }...
TableDeleteFamilyHandler extends TableEventHandler { @Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(familyName); }...
@Test public void testCleanParent() throws IOException, InterruptedException { HBaseTestingUtility htu = new HBaseTestingUtility(); setRootDirAndCleanIt(htu, "testCleanParent"); Server server = new MockServer(htu); try { MasterServices services = new MockMasterServices(server); CatalogJanitor janitor = new CatalogJanit...
boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<Boolean, Boolean> a = checkDaug...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
@Test public void testArchiveOldRegion() throws Exception { String table = "table"; HBaseTestingUtility htu = new HBaseTestingUtility(); setRootDirAndCleanIt(htu, "testCleanParent"); Server server = new MockServer(htu); MasterServices services = new MockMasterServices(server); CatalogJanitor janitor = new CatalogJanito...
boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<Boolean, Boolean> a = checkDaug...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
@Test public void testDuplicateHFileResolution() throws Exception { String table = "table"; HBaseTestingUtility htu = new HBaseTestingUtility(); setRootDirAndCleanIt(htu, "testCleanParent"); Server server = new MockServer(htu); MasterServices services = new MockMasterServices(server); CatalogJanitor janitor = new Catal...
boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<Boolean, Boolean> a = checkDaug...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
CatalogJanitor extends Chore { boolean cleanParent(final HRegionInfo parent, Result rowContent) throws IOException { boolean result = false; HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER); HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER); Pair<...
@Test public void testTaskCreation() throws Exception { LOG.info("TestTaskCreation - test the creation of a task in zk"); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = submitTaskAndWait(batch, "foo/1"); byte[...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testMultipleResubmits() throws Exception { LOG.info("TestMultipleResbmits - no indefinite resubmissions"); conf.setInt("hbase.splitlog.max.resubmit", 2); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String t...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testRescanCleanup() throws Exception { LOG.info("TestRescanCleanup - ensure RESCAN nodes are cleaned up"); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = submitTaskAndWait(batch, "foo/1"); in...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testMultiCellGetJSONNotFound() throws IOException { String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1; StringBuilder path = new StringBuilder(); path.append("/"); path.append(TABLE); path.append("/multiget/?row="); path.append(ROW_1); path.append("&row="); path.append(ROW_2); client.post(r...
@GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model = new CellSetModel(); for (String rk : ...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
MultiRowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { MultivaluedMap<String, String> params = uriInfo.getQueryParameters(); servlet.getMetrics().incrementRequests(1); try { CellSetModel model...
@Test public void testTaskDone() throws Exception { LOG.info("TestTaskDone - cleanup task node once in DONE state"); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = submitTaskAndWait(batch, "foo/1"); ZKUtil.set...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testTaskErr() throws Exception { LOG.info("TestTaskErr - cleanup task node once in ERR state"); conf.setInt("hbase.splitlog.max.resubmit", 0); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = s...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testTaskResigned() throws Exception { LOG.info("TestTaskResigned - resubmit task node once in RESIGNED state"); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = submitTaskAndWait(batch, "foo/1"...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testUnassignedTimeout() throws Exception { LOG.info("TestUnassignedTimeout - iff all tasks are unassigned then" + " resubmit"); String tasknode1 = ZKSplitLog.getEncodedNodeName(zkw, "orphan/1"); zkw.getRecoverableZooKeeper().create(tasknode1, TaskState.TASK_OWNED.get("dummy-worker"), Ids.OPEN_ACL_UNSA...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testWorkerCrash() throws Exception { conf.setInt("hbase.splitlog.max.resubmit", ZKSplitLog.DEFAULT_MAX_RESUBMIT); slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null); slm.finishInitialization(); TaskBatch batch = new TaskBatch(); String tasknode = submitTaskAndWait(batch, "foo/...
public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } }
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
SplitLogManager extends ZooKeeperListener { public void finishInitialization(boolean masterRecovery) { if (!masterRecovery) { Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName + ".splitLogManagerTimeoutMonitor"); } if (this.watcher != null) { this.watcher.registerListener(this); lookForOrphans(); } ...
@Test public void testBalanceCluster() throws Exception { for(int [] mockCluster : clusterStateMocks) { Map<ServerName, List<HRegionInfo>> servers = mockClusterServers(mockCluster); List <ServerAndLoad> list = convertToList(servers); LOG.info("Mock Cluster : " + printMock(list) + " " + printStats(list)); List<RegionPla...
public List<RegionPlan> balanceCluster( Map<ServerName, List<HRegionInfo>> clusterState) { boolean emptyRegionServerPresent = false; long startTime = System.currentTimeMillis(); int numServers = clusterState.size(); if (numServers == 0) { LOG.debug("numServers=0 so skipping load balancing"); return null; } NavigableMap...
DefaultLoadBalancer implements LoadBalancer { public List<RegionPlan> balanceCluster( Map<ServerName, List<HRegionInfo>> clusterState) { boolean emptyRegionServerPresent = false; long startTime = System.currentTimeMillis(); int numServers = clusterState.size(); if (numServers == 0) { LOG.debug("numServers=0 so skipping...
DefaultLoadBalancer implements LoadBalancer { public List<RegionPlan> balanceCluster( Map<ServerName, List<HRegionInfo>> clusterState) { boolean emptyRegionServerPresent = false; long startTime = System.currentTimeMillis(); int numServers = clusterState.size(); if (numServers == 0) { LOG.debug("numServers=0 so skipping...
DefaultLoadBalancer implements LoadBalancer { public List<RegionPlan> balanceCluster( Map<ServerName, List<HRegionInfo>> clusterState) { boolean emptyRegionServerPresent = false; long startTime = System.currentTimeMillis(); int numServers = clusterState.size(); if (numServers == 0) { LOG.debug("numServers=0 so skipping...
DefaultLoadBalancer implements LoadBalancer { public List<RegionPlan> balanceCluster( Map<ServerName, List<HRegionInfo>> clusterState) { boolean emptyRegionServerPresent = false; long startTime = System.currentTimeMillis(); int numServers = clusterState.size(); if (numServers == 0) { LOG.debug("numServers=0 so skipping...
@Test public void testImmediateAssignment() throws Exception { for(int [] mock : regionsAndServersMocks) { LOG.debug("testImmediateAssignment with " + mock[0] + " regions and " + mock[1] + " servers"); List<HRegionInfo> regions = randomRegions(mock[0]); List<ServerAndLoad> servers = randomServers(mock[1], 0); List<Serv...
public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.nextInt(servers.size()))); } return assignments;...
DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.ne...
DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.ne...
DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.ne...
DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.ne...
@Test public void testBulkAssignment() throws Exception { for(int [] mock : regionsAndServersMocks) { LOG.debug("testBulkAssignment with " + mock[0] + " regions and " + mock[1] + " servers"); List<HRegionInfo> regions = randomRegions(mock[0]); List<ServerAndLoad> servers = randomServers(mock[1], 0); List<ServerName> li...
public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRegionInfo>>(); int numRegions = regions.size(); int numServer...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRegionInfo>>(); ...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRegionInfo>>(); ...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRegionInfo>>(); ...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRegionInfo>>(); ...
@Test public void testRetainAssignment() throws Exception { List<ServerAndLoad> servers = randomServers(10, 10); List<HRegionInfo> regions = randomRegions(100); Map<HRegionInfo, ServerName> existing = new TreeMap<HRegionInfo, ServerName>(); for (int i = 0; i < regions.size(); i++) { ServerName sn = servers.get(i % serv...
public Map<ServerName, List<HRegionInfo>> retainAssignment( Map<HRegionInfo, ServerName> regions, List<ServerName> servers) { ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create(); for (ServerName server : servers) { serversByHostname.put(server.getHostname(), server); } Map<ServerName, L...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> retainAssignment( Map<HRegionInfo, ServerName> regions, List<ServerName> servers) { ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create(); for (ServerName server : servers) { serversByHostname.put(serv...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> retainAssignment( Map<HRegionInfo, ServerName> regions, List<ServerName> servers) { ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create(); for (ServerName server : servers) { serversByHostname.put(serv...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> retainAssignment( Map<HRegionInfo, ServerName> regions, List<ServerName> servers) { ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create(); for (ServerName server : servers) { serversByHostname.put(serv...
DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> retainAssignment( Map<HRegionInfo, ServerName> regions, List<ServerName> servers) { ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create(); for (ServerName server : servers) { serversByHostname.put(serv...
@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, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOException e) { e = RemoteException...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
@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, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOException e) { e = RemoteException...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
@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, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOException e) { e = RemoteException...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
@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, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOException e) { e = RemoteException...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
@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, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOException e) { e = RemoteException...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
CleanerChore extends Chore { @Override protected void chore() { try { FileStatus[] files = FSUtils.listStatus(this.fs, this.oldFileDir, null); if (files == null) return; for (FileStatus file : files) { try { if (file.isDir()) checkAndDeleteDirectory(file.getPath()); else checkAndDelete(file.getPath()); } catch (IOExcep...
@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...
public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFromFileSystem(fs, toCheck); } catch (IOExcep...
CleanerChore extends Chore { public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFromFileSystem(f...
CleanerChore extends Chore { public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFromFileSystem(f...
CleanerChore extends Chore { public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFromFileSystem(f...
CleanerChore extends Chore { public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFromFileSystem(f...
@Test public void testLoadsTmpDir() throws Exception { long period = Long.MAX_VALUE; Path snapshotDir = SnapshotDescriptionUtils.getSnapshotsDir(rootDir); SnapshotFileCache cache = new SnapshotFileCache(fs, rootDir, period, 10000000, "test-snapshot-file-cache-refresh", new SnapshotFiles()); Path snapshot = new Path(sna...
public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
@Test public void testJustFindLogsDirectory() throws Exception { long period = Long.MAX_VALUE; Path snapshotDir = SnapshotDescriptionUtils.getSnapshotsDir(rootDir); SnapshotFileCache cache = new SnapshotFileCache(fs, rootDir, period, 10000000, "test-snapshot-file-cache-refresh", new SnapshotFileCache.SnapshotFileInspec...
public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
@Test public void testReloadModifiedDirectory() throws IOException { long period = Long.MAX_VALUE; Path snapshotDir = SnapshotDescriptionUtils.getSnapshotsDir(rootDir); SnapshotFileCache cache = new SnapshotFileCache(fs, rootDir, period, 10000000, "test-snapshot-file-cache-refresh", new SnapshotFiles()); Path snapshot ...
public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } }
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
SnapshotFileCache implements Stoppable { public synchronized boolean contains(String fileName) throws IOException { if (this.cache.contains(fileName)) return true; refreshCache(); return this.cache.contains(fileName); } SnapshotFileCache(Configuration conf, long cacheRefreshPeriod, String refreshThreadName, Snaps...
@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( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUtils.getRootDir(conf); cache = new SnapshotFileCache(...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUt...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUt...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUt...
SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path rootDir = FSUt...
@Test public void testPrepare() throws IOException { prepareGOOD_SPLIT_ROW(); }
public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegio...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
@Test public void testDelete() throws IOException, JAXBException { Response response = putValueXML(TABLE, ROW_1, COLUMN_1, VALUE_1); assertEquals(response.getCode(), 200); response = putValueXML(TABLE, ROW_1, COLUMN_2, VALUE_2); assertEquals(response.getCode(), 200); checkValueXML(TABLE, ROW_1, COLUMN_1, VALUE_1); chec...
@DELETE public Response delete(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); if (servlet.isReadOnly()) { return Response.status(Response.Status.FORBIDDEN) .type(MIMETYPE_TEXT).entity("Forbidden" + CRLF) .build...
RowResource extends ResourceBase { @DELETE public Response delete(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); if (servlet.isReadOnly()) { return Response.status(Response.Status.FORBIDDEN) .type(MIMETYPE_TEXT...
RowResource extends ResourceBase { @DELETE public Response delete(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); if (servlet.isReadOnly()) { return Response.status(Response.Status.FORBIDDEN) .type(MIMETYPE_TEXT...
RowResource extends ResourceBase { @DELETE public Response delete(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); if (servlet.isReadOnly()) { return Response.status(Response.Status.FORBIDDEN) .type(MIMETYPE_TEXT...
RowResource extends ResourceBase { @DELETE public Response delete(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); if (servlet.isReadOnly()) { return Response.status(Response.Status.FORBIDDEN) .type(MIMETYPE_TEXT...
@Test public void testPrepareWithRegionsWithReference() throws IOException { StoreFile storeFileMock = Mockito.mock(StoreFile.class); when(storeFileMock.isReference()).thenReturn(true); Store storeMock = Mockito.mock(Store.class); List<StoreFile> storeFileList = new ArrayList<StoreFile>(1); storeFileList.add(storeFileM...
public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegio...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
@Test public void testPrepareWithBadSplitRow() throws IOException { SplitTransaction st = new SplitTransaction(this.parent, STARTROW); assertFalse(st.prepare()); st = new SplitTransaction(this.parent, HConstants.EMPTY_BYTE_ARRAY); assertFalse(st.prepare()); st = new SplitTransaction(this.parent, new byte [] {'A', 'A', ...
public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegio...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
@Test public void testPrepareWithClosedRegion() throws IOException { this.parent.close(); SplitTransaction st = new SplitTransaction(this.parent, GOOD_SPLIT_ROW); assertFalse(st.prepare()); }
public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegio...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !t...
@Test public void testRollback() throws IOException { final int rowcount = TEST_UTIL.loadRegion(this.parent, CF); assertTrue(rowcount > 0); int parentRowCount = countRows(this.parent); assertEquals(rowcount, parentRowCount); SplitTransaction st = prepareGOOD_SPLIT_ROW(); SplitTransaction spiedUponSt = spy(st); when(spi...
public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious()) { JournalEntry je = iterator.pre...
SplitTransaction { public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious()) { JournalEntr...
SplitTransaction { public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious()) { JournalEntr...
SplitTransaction { public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious()) { JournalEntr...
SplitTransaction { public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious()) { JournalEntr...
@Test public void testGenerateSchemaMetricsPrefix() { String tableName = "table1"; int numCF = 3; StringBuilder expected = new StringBuilder(); if (useTableName) { expected.append("tbl."); expected.append(tableName); expected.append("."); } expected.append("cf."); Set<byte[]> families = new HashSet<byte[]>(); for (int ...
public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PREFIX + cfName + "."; return sc...
SchemaMetrics { public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PREFIX + cfName ...
SchemaMetrics { public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PREFIX + cfName ...
SchemaMetrics { public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PREFIX + cfName ...
SchemaMetrics { public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PREFIX + cfName ...
@Test public void testToString() throws JSONException { SchemaConfigured sc = new SchemaConfigured(null, TABLE_NAME, CF_NAME); JSONStringer json = new JSONStringer(); json.object(); json.key("tableName"); json.value(TABLE_NAME); json.key("cfName"); json.value(CF_NAME); json.endObject(); assertEquals(json.toString(), sc...
public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; }
SchemaConfigured implements HeapSize, SchemaAware { public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; } }
SchemaConfigured implements HeapSize, SchemaAware { public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigured(Configuration conf, Path path); SchemaConfigured(Path path); Sche...
SchemaConfigured implements HeapSize, SchemaAware { public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigured(Configuration conf, Path path); SchemaConfigured(Path path); Sche...
SchemaConfigured implements HeapSize, SchemaAware { public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigured(Configuration conf, Path path); SchemaConfigured(Path path); Sche...
@Test(expected=IllegalStateException.class) public void testConfigureWithUnconfigured1() { SchemaConfigured unconfigured = new SchemaConfigured(null, "t1", null); SchemaConfigured target = new SchemaConfigured(); unconfigured.passSchemaMetricsTo(target); }
public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { throw new IllegalArgumentException("Trying to change...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
@Test(expected=IllegalStateException.class) public void testConfigureWithUnconfigured2() { SchemaConfigured unconfigured = new SchemaConfigured(null, null, "cf1"); SchemaConfigured target = new SchemaConfigured(); unconfigured.passSchemaMetricsTo(target); }
public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { throw new IllegalArgumentException("Trying to change...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
@Test(expected=IllegalArgumentException.class) public void testConflictingConf() { SchemaConfigured sc = new SchemaConfigured(null, "t1", "cf1"); SchemaConfigured target = new SchemaConfigured(null, "t2", "cf1"); sc.passSchemaMetricsTo(target); }
public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { throw new IllegalArgumentException("Trying to change...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
@Test public void testTmpPath() { SchemaConfigured sc = new SchemaConfigured(null, "myTable", "myCF"); SchemaConfigured target = new SchemaConfigured(TMP_HFILE_PATH); sc.passSchemaMetricsTo(target); }
public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { throw new IllegalArgumentException("Trying to change...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
@Test public void testStartEndRowGetPutXML() throws IOException, JAXBException { String[] rows = { ROW_1, ROW_2, ROW_3 }; String[] values = { VALUE_1, VALUE_2, VALUE_3 }; Response response = null; for (int i = 0; i < rows.length; i++) { response = putValueXML(TABLE, rows[i], COLUMN_1, values[i]); assertEquals(200, resp...
@GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try { ResultGenerator generator = ResultGenerator.fromRow...
RowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try { ResultGenerator ...
RowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try { ResultGenerator ...
RowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try { ResultGenerator ...
RowResource extends ResourceBase { @GET @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try { ResultGenerator ...
@Test(expected=IllegalArgumentException.class) public void testTmpPathButInvalidTable() { SchemaConfigured sc = new SchemaConfigured(null, "anotherTable", "myCF"); SchemaConfigured target = new SchemaConfigured(TMP_HFILE_PATH); sc.passSchemaMetricsTo(target); }
public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { throw new IllegalArgumentException("Trying to change...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWith(target)) { ...
@Test public void testResetSchemaMetricsConf() { SchemaConfigured target = new SchemaConfigured(null, "t1", "cf1"); SchemaConfigured.resetSchemaMetricsConf(target); new SchemaConfigured(null, "t2", "cf2").passSchemaMetricsTo(target); assertEquals("t2", target.getTableName()); assertEquals("cf2", target.getColumnFamilyN...
public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); }
SchemaConfigured implements HeapSize, SchemaAware { public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); } }
SchemaConfigured implements HeapSize, SchemaAware { public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigure...
SchemaConfigured implements HeapSize, SchemaAware { public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigure...
SchemaConfigured implements HeapSize, SchemaAware { public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigure...
@Test public void testFailedOpenRegion() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = new MockRegionServerServices(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZKAssign.transitionNodeOpening(server.getZooKeeper(), TEST_HRI, server.g...
@Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regionInfo.getEncodedName(); HReg...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
@Test public void testFailedUpdateMeta() throws Exception { Server server = new MockServer(HTU); RegionServerServices rsServices = new MockRegionServerServices(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZKAssign.transitionNodeOpening(server.getZooKeeper(), TEST_HRI, server.g...
@Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regionInfo.getEncodedName(); HReg...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
@Test public void testTransitionToFailedOpenEvenIfCleanupFails() throws Exception { MiniHBaseCluster cluster = HTU.getHBaseCluster(); HRegionServer server = cluster.getLiveRegionServerThreads().get(0).getRegionServer(); ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName()); ZKAssign.transi...
@Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encodedName = regionInfo.getEncodedName(); HReg...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
OpenRegionHandler extends EventHandler { @Override public void process() throws IOException { boolean transitionToFailedOpen = false; boolean openSuccessful = false; try { final String name = regionInfo.getRegionNameAsString(); if (this.server.isStopped() || this.rsServices.isStopping()) { return; } final String encode...
@Test public void testFailedFlushAborts() throws IOException, NodeExistsException, KeeperException { final Server server = new MockServer(HTU, false); final RegionServerServices rss = new MockRegionServerServices(); HTableDescriptor htd = TEST_HTD; final HRegionInfo hri = new HRegionInfo(htd.getName(), HConstants.EMPTY...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for 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 = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
@Test public void testZKClosingNodeVersionMismatch() throws IOException, NodeExistsException, KeeperException { final Server server = new MockServer(HTU); final MockRegionServerServices rss = new MockRegionServerServices(); rss.setFileSystem(HTU.getTestFileSystem()); HTableDescriptor htd = TEST_HTD; final HRegionInfo h...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for 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 = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
@Test public void testExecutorService() throws Exception { int maxThreads = 5; int maxTries = 10; int sleepInterval = 10; Server mockedServer = mock(Server.class); when(mockedServer.getConfiguration()).thenReturn(HBaseConfiguration.create()); ExecutorService executorService = new ExecutorService("unit_test"); executorS...
public ExecutorService(final String servername) { super(); this.servername = servername; }
ExecutorService { public ExecutorService(final String servername) { super(); this.servername = servername; } }
ExecutorService { public ExecutorService(final String servername) { super(); this.servername = servername; } ExecutorService(final String servername); }
ExecutorService { public ExecutorService(final String servername) { super(); this.servername = servername; } ExecutorService(final String servername); ExecutorType getExecutorServiceType(final EventHandler.EventType type); void shutdown(); void startExecutorService(final ExecutorType type, final int maxThreads); void s...
ExecutorService { public ExecutorService(final String servername) { super(); this.servername = servername; } ExecutorService(final String servername); ExecutorType getExecutorServiceType(final EventHandler.EventType type); void shutdown(); void startExecutorService(final ExecutorType type, final int maxThreads); void s...
@Test public void testCloseRegion() throws IOException, NodeExistsException, KeeperException { final Server server = new MockServer(HTU); final MockRegionServerServices rss = new MockRegionServerServices(); rss.setFileSystem(HTU.getTestFileSystem()); HTableDescriptor htd = TEST_HTD; HRegionInfo hri = TEST_HRI; OpenRegi...
@Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for 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 = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
CloseRegionHandler extends EventHandler { @Override public void process() { try { String name = regionInfo.getRegionNameAsString(); LOG.debug("Processing close of " + name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = this.rsServices.getFromOnlineRegions(encodedRegionName); if (region == nu...
@Test public void testCreateDefault() throws IOException { conf.setLong(HConstants.HREGION_MAX_FILESIZE, 1234L); ConstantSizeRegionSplitPolicy policy = (ConstantSizeRegionSplitPolicy)RegionSplitPolicy.create( mockRegion, conf); assertEquals(1234L, policy.getDesiredMaxFileSize()); htd.setMaxFileSize(9999L); policy = (Co...
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 testConstantSizePolicy() throws IOException { htd.setMaxFileSize(1024L); ConstantSizeRegionSplitPolicy policy = (ConstantSizeRegionSplitPolicy)RegionSplitPolicy.create(mockRegion, conf); doConstantSizePolicyTests(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 testGetSplitPoint() throws IOException { ConstantSizeRegionSplitPolicy policy = (ConstantSizeRegionSplitPolicy)RegionSplitPolicy.create(mockRegion, conf); assertFalse(policy.shouldSplit()); assertNull(policy.getSplitPoint()); Store mockStore = Mockito.mock(Store.class); Mockito.doReturn(2000L).when(mo...
protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; for (Store s : stores.values()) { byte[]...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; f...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; f...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; f...
RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestStoreSize = 0; f...
@Test public void testSplit() throws IOException { final byte [] tableName = Bytes.toBytes(getName()); final byte [] rowName = tableName; Path logdir = new Path(hbaseDir, HConstants.HREGION_LOGDIR_NAME); HLog log = new HLog(fs, logdir, oldLogDir, conf); final int howmany = 3; HRegionInfo[] infos = new HRegionInfo[3]; P...
private static void split(final Configuration conf, final Path p) throws IOException { FileSystem fs = FileSystem.get(conf); if (!fs.exists(p)) { throw new FileNotFoundException(p.toString()); } final Path baseDir = new Path(conf.get(HConstants.HBASE_DIR)); final Path oldLogDir = new Path(baseDir, HConstants.HREGION_OL...
HLog implements Syncable { private static void split(final Configuration conf, final Path p) throws IOException { FileSystem fs = FileSystem.get(conf); if (!fs.exists(p)) { throw new FileNotFoundException(p.toString()); } final Path baseDir = new Path(conf.get(HConstants.HBASE_DIR)); final Path oldLogDir = new Path(bas...
HLog implements Syncable { private static void split(final Configuration conf, final Path p) throws IOException { FileSystem fs = FileSystem.get(conf); if (!fs.exists(p)) { throw new FileNotFoundException(p.toString()); } final Path baseDir = new Path(conf.get(HConstants.HBASE_DIR)); final Path oldLogDir = new Path(bas...
HLog implements Syncable { private static void split(final Configuration conf, final Path p) throws IOException { FileSystem fs = FileSystem.get(conf); if (!fs.exists(p)) { throw new FileNotFoundException(p.toString()); } final Path baseDir = new Path(conf.get(HConstants.HBASE_DIR)); final Path oldLogDir = new Path(bas...
HLog implements Syncable { private static void split(final Configuration conf, final Path p) throws IOException { FileSystem fs = FileSystem.get(conf); if (!fs.exists(p)) { throw new FileNotFoundException(p.toString()); } final Path baseDir = new Path(conf.get(HConstants.HBASE_DIR)); final Path oldLogDir = new Path(bas...
@Test public void testFindMemstoresWithEditsEqualOrOlderThan() throws IOException { Map<byte [], Long> regionsToSeqids = new HashMap<byte [], Long>(); for (int i = 0; i < 10; i++) { Long l = Long.valueOf(i); regionsToSeqids.put(l.toString().getBytes(), l); } byte [][] regions = HLog.findMemstoresWithEditsEqualOrOlderTh...
static byte [][] findMemstoresWithEditsEqualOrOlderThan(final long oldestWALseqid, final Map<byte [], Long> regionsToSeqids) { List<byte []> regions = null; for (Map.Entry<byte [], Long> e: regionsToSeqids.entrySet()) { if (e.getValue().longValue() <= oldestWALseqid) { if (regions == null) regions = new ArrayList<byte ...
HLog implements Syncable { static byte [][] findMemstoresWithEditsEqualOrOlderThan(final long oldestWALseqid, final Map<byte [], Long> regionsToSeqids) { List<byte []> regions = null; for (Map.Entry<byte [], Long> e: regionsToSeqids.entrySet()) { if (e.getValue().longValue() <= oldestWALseqid) { if (regions == null) re...
HLog implements Syncable { static byte [][] findMemstoresWithEditsEqualOrOlderThan(final long oldestWALseqid, final Map<byte [], Long> regionsToSeqids) { List<byte []> regions = null; for (Map.Entry<byte [], Long> e: regionsToSeqids.entrySet()) { if (e.getValue().longValue() <= oldestWALseqid) { if (regions == null) re...
HLog implements Syncable { static byte [][] findMemstoresWithEditsEqualOrOlderThan(final long oldestWALseqid, final Map<byte [], Long> regionsToSeqids) { List<byte []> regions = null; for (Map.Entry<byte [], Long> e: regionsToSeqids.entrySet()) { if (e.getValue().longValue() <= oldestWALseqid) { if (regions == null) re...
HLog implements Syncable { static byte [][] findMemstoresWithEditsEqualOrOlderThan(final long oldestWALseqid, final Map<byte [], Long> regionsToSeqids) { List<byte []> regions = null; for (Map.Entry<byte [], Long> e: regionsToSeqids.entrySet()) { if (e.getValue().longValue() <= oldestWALseqid) { if (regions == null) re...
@Test public void testAppend() throws IOException { final int COL_COUNT = 10; final byte [] tableName = Bytes.toBytes("tablename"); final byte [] row = Bytes.toBytes("row"); Reader reader = null; HLog log = new HLog(fs, dir, oldLogDir, conf); try { long timestamp = System.currentTimeMillis(); WALEdit cols = new WALEdit...
public long append(HRegionInfo regionInfo, HLogKey logKey, WALEdit logEdit, HTableDescriptor htd, boolean doSync) throws IOException { if (this.closed) { throw new IOException("Cannot append; log is closed"); } long txid = 0; synchronized (updateLock) { long seqNum = obtainSeqNum(); logKey.setLogSeqNum(seqNum); this.la...
HLog implements Syncable { public long append(HRegionInfo regionInfo, HLogKey logKey, WALEdit logEdit, HTableDescriptor htd, boolean doSync) throws IOException { if (this.closed) { throw new IOException("Cannot append; log is closed"); } long txid = 0; synchronized (updateLock) { long seqNum = obtainSeqNum(); logKey.se...
HLog implements Syncable { public long append(HRegionInfo regionInfo, HLogKey logKey, WALEdit logEdit, HTableDescriptor htd, boolean doSync) throws IOException { if (this.closed) { throw new IOException("Cannot append; log is closed"); } long txid = 0; synchronized (updateLock) { long seqNum = obtainSeqNum(); logKey.se...
HLog implements Syncable { public long append(HRegionInfo regionInfo, HLogKey logKey, WALEdit logEdit, HTableDescriptor htd, boolean doSync) throws IOException { if (this.closed) { throw new IOException("Cannot append; log is closed"); } long txid = 0; synchronized (updateLock) { long seqNum = obtainSeqNum(); logKey.se...
HLog implements Syncable { public long append(HRegionInfo regionInfo, HLogKey logKey, WALEdit logEdit, HTableDescriptor htd, boolean doSync) throws IOException { if (this.closed) { throw new IOException("Cannot append; log is closed"); } long txid = 0; synchronized (updateLock) { long seqNum = obtainSeqNum(); logKey.se...
@Test public void testPassingSameArrayToAddEntry() { int len = HConstants.CATALOG_FAMILY.length; int index = testee.addEntry(HConstants.CATALOG_FAMILY, 0, len); assertFalse(index == testee.addEntry(HConstants.CATALOG_FAMILY, 0, len)); assertFalse(index == testee.addEntry(HConstants.CATALOG_FAMILY, 0, len)); }
@Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); }
LRUDictionary implements Dictionary { @Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); } }
LRUDictionary implements Dictionary { @Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); } }
LRUDictionary implements Dictionary { @Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); } @Override byte[] getEntry(short idx); @Override short findEntry(byte[] data, int offset, int length); @Override short ...
LRUDictionary implements Dictionary { @Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); } @Override byte[] getEntry(short idx); @Override short findEntry(byte[] data, int offset, int length); @Override short ...
@Test (expected=IllegalArgumentException.class) public void testRegexAgainstOldStyleTableInfo() { Path p = new Path("/tmp", FSTableDescriptors.TABLEINFO_NAME); int i = FSTableDescriptors.getTableInfoSequenceid(p); assertEquals(0, i); p = new Path("/tmp", "abc"); FSTableDescriptors.getTableInfoSequenceid(p); }
static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) return 0; return Integer.parseInt(m.group(2)); }
FSTableDescriptors implements TableDescriptors { static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) return 0; retur...
FSTableDescriptors implements TableDescriptors { static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) return 0; retur...
FSTableDescriptors implements TableDescriptors { static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) return 0; retur...
FSTableDescriptors implements TableDescriptors { static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) return 0; retur...
@Test public void TestLRUPolicy(){ for (int i = 0; i < LRUDictionary.BidirectionalLRUMap.MAX_SIZE; i++) { testee.findEntry((BigInteger.valueOf(i)).toByteArray(), 0, (BigInteger.valueOf(i)).toByteArray().length); } assertTrue(testee.findEntry(BigInteger.ZERO.toByteArray(), 0, BigInteger.ZERO.toByteArray().length) != -1)...
@Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; }
LRUDictionary implements Dictionary { @Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; } }
LRUDictionary implements Dictionary { @Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; } }
LRUDictionary implements Dictionary { @Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; } @Override byte[] getEntry(short idx); @Override short findEntry(byte[] da...
LRUDictionary implements Dictionary { @Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; } @Override byte[] getEntry(short idx); @Override short findEntry(byte[] da...
@Test public void testAcquireTaskAtStartup() throws Exception { LOG.info("testAcquireTaskAtStartup"); ZKSplitLog.Counters.resetCounters(); zkw.getRecoverableZooKeeper().create(ZKSplitLog.getEncodedNodeName(zkw, "tatas"), TaskState.TASK_UNASSIGNED.get("mgr"), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); SplitLogWorker s...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
@Test public void testRaceForTask() throws Exception { LOG.info("testRaceForTask"); ZKSplitLog.Counters.resetCounters(); zkw.getRecoverableZooKeeper().create(ZKSplitLog.getEncodedNodeName(zkw, "trft"), TaskState.TASK_UNASSIGNED.get("manager"), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); SplitLogWorker slw1 = new Split...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
@Test public void testPreemptTask() throws Exception { LOG.info("testPreemptTask"); ZKSplitLog.Counters.resetCounters(); SplitLogWorker slw = new SplitLogWorker(zkw, TEST_UTIL.getConfiguration(), "tpt_svr", neverEndingTask); slw.start(); try { Thread.yield(); Thread.sleep(100); zkw.getRecoverableZooKeeper().create(ZKSp...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
@Test public void testMultipleTasks() throws Exception { LOG.info("testMultipleTasks"); ZKSplitLog.Counters.resetCounters(); SplitLogWorker slw = new SplitLogWorker(zkw, TEST_UTIL.getConfiguration(), "tmt_svr", neverEndingTask); slw.start(); try { Thread.yield(); Thread.sleep(100); zkw.getRecoverableZooKeeper().create(...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
@Test public void testRescan() throws Exception { LOG.info("testRescan"); ZKSplitLog.Counters.resetCounters(); slw = new SplitLogWorker(zkw, TEST_UTIL.getConfiguration(), "svr", neverEndingTask); slw.start(); Thread.yield(); Thread.sleep(200); String task = ZKSplitLog.getEncodedNodeName(zkw, "task"); zkw.getRecoverable...
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); return; } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, String serverName, TaskExecutor splitTaskExecutor); Spli...