s.setRange(ReplicationSection.getRange()); MetadataSchema.ReplicationSection.getFile(entry.getKey(), file); Table.ID tableId = MetadataSchema.ReplicationSection.getTableId(entry.getKey());
bw = client.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); bs = client.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 4); bs.setRanges(Collections.singleton(Range.prefix(ReplicationSection.getRowPrefix()))); bs.fetchColumnFamily(ReplicationSection.COLF); MetadataSchema.ReplicationSection.getFile(entry.getKey(), replFileText); String replFile = replFileText.toString(); boolean isClosed = closedWals.contains(replFile);
for (int i = 0; i < 5; i++) { s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY); s.setRange(ReplicationSection.getRange()); entries.clear(); for (Entry<Key,Value> entry : s) { for (int i = 0; i < 10; i++) { s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY); s.setRange(ReplicationSection.getRange()); remaining.clear(); for (Entry<Key,Value> e : s) {
s.setRange(Range.prefix(ReplicationSection.getRowPrefix())); Iterator<Entry<Key,Value>> iter = s.iterator(); s.setRange(Range.prefix(ReplicationSection.getRowPrefix())); for (Entry<Key,Value> entry : s) { log.info(entry.getKey().toStringNoTruncate() + " "
s.setRange(MetadataSchema.ReplicationSection.getRange()); for (Entry<Key,Value> entry : s) { System.out.println(entry.getKey().toStringNoTruncate() + " " MetadataSchema.ReplicationSection.getRowPrefix() + new Path(walUri).toString()); m.put(MetadataSchema.ReplicationSection.COLF, new Text(tableId), new Value(StatusUtil.fileCreated(System.currentTimeMillis()).toByteArray())); s.setRange(MetadataSchema.ReplicationSection.getRange()); for (Entry<Key,Value> entry : s) { log.info(entry.getKey().toStringNoTruncate() + " " s.setRange(MetadataSchema.ReplicationSection.getRange()); for (Entry<Key,Value> entry : s) { Status status = Status.parseFrom(entry.getValue().get());
s.setRange(MetadataSchema.ReplicationSection.getRange()); for (Entry<Key,Value> metadata : s) { records.add(metadata);
long index = 1; for (String file : files) { Mutation m = new Mutation(ReplicationSection.getRowPrefix() + file); m.put(ReplicationSection.COLF, new Text(Long.toString(index)), ProtobufUtil.toValue(statBuilder.build())); s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); Assert.assertEquals(0, Iterables.size(s)); s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); Assert.assertEquals(0, Iterables.size(s)); s.setRange(ReplicationSection.getRange()); iter = s.iterator(); Assert.assertTrue("Found no stat records in replication table", iter.hasNext());
s.setRange(ReplicationSection.getRange()); MetadataSchema.ReplicationSection.getFile(entry.getKey(), file); String tableId = MetadataSchema.ReplicationSection.getTableId(entry.getKey());
m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.put(ReplicationSection.COLF, new Text(tableId1), ProtobufUtil.toValue(stat)); m = new Mutation(ReplicationSection.getRowPrefix() + file2); m.put(ReplicationSection.COLF, new Text(tableId2), ProtobufUtil.toValue(stat)); m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.putDelete(ReplicationSection.COLF, new Text(tableId1)); bw.addMutation(m);
m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.put(ReplicationSection.COLF, new Text(tableId), ProtobufUtil.toValue(stat)); m = new Mutation(ReplicationSection.getRowPrefix() + file2); m.put(ReplicationSection.COLF, new Text(tableId), ProtobufUtil.toValue(stat)); m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.putDelete(ReplicationSection.COLF, new Text(tableId)); bw.addMutation(m); m = new Mutation(ReplicationSection.getRowPrefix() + file2); m.putDelete(ReplicationSection.COLF, new Text(tableId)); bw.addMutation(m);
m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.put(ReplicationSection.COLF, new Text(tableId1), ProtobufUtil.toValue(stat)); bw.addMutation(m); .setClosed(true).build(); bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.put(ReplicationSection.COLF, new Text(tableId1), ProtobufUtil.toValue(newStatus)); bw.addMutation(m);
m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.put(ReplicationSection.COLF, new Text(tableId1), ProtobufUtil.toValue(stat)); bw.addMutation(m); ReplicationSection.getRowPrefix() + "/accumulo/wals/tserver+port/" + UUID.randomUUID()); m.put(ReplicationSection.COLF, new Text(tableId1), ProtobufUtil.toValue(stat)); bw.addMutation(m); m = new Mutation(ReplicationSection.getRowPrefix() + file1); m.putDelete(ReplicationSection.COLF, new Text(tableId1)); bw.addMutation(m);
bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); bs = conn.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 4); bs.setRanges(Collections.singleton(Range.prefix(ReplicationSection.getRowPrefix()))); bs.fetchColumnFamily(ReplicationSection.COLF); MetadataSchema.ReplicationSection.getFile(entry.getKey(), replFileText); String replFile = replFileText.toString(); boolean isClosed = closedWals.contains(replFile);
for (String file : files) { statBuilder.setCreatedTime(time++); Mutation m = new Mutation(ReplicationSection.getRowPrefix() + file); m.put(ReplicationSection.COLF, new Text(Integer.toString(index)), ProtobufUtil.toValue(statBuilder.build())); s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); Assert.assertEquals(0, Iterables.size(s));
Map<String,Long> fileToTimeCreated = new HashMap<>(); for (String file : files) { Mutation m = new Mutation(ReplicationSection.getRowPrefix() + file); m.put(ReplicationSection.COLF, new Text(Integer.toString(index)), StatusUtil.fileCreatedValue(timeCreated));
final Set<Range> range = Collections.singleton(new Range(ReplicationSection.getRange())); BatchScanner bs; try {
s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); for (Entry<Key,Value> entry : s) {
if (colfHolder.equals(ReplicationSection.COLF)) { file = rowHolder.toString(); file = file.substring(ReplicationSection.getRowPrefix().length()); } else if (colfHolder.equals(OrderSection.NAME)) { file = OrderSection.getFile(entry.getKey(), rowHolder);
Mutation m = new Mutation(ReplicationSection.getRowPrefix() + file); m.put(ReplicationSection.COLF, new Text(Integer.toString(index)), ProtobufUtil.toValue(stat)); bw.addMutation(m); s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); for (Entry<Key,Value> e : s) { s.setRange(ReplicationSection.getRange()); s.fetchColumnFamily(ReplicationSection.COLF); Assert.assertEquals(0, Iterables.size(s));
metaBs.setRanges(Collections.singleton(ReplicationSection.getRange())); metaBs.fetchColumnFamily(ReplicationSection.COLF); try { Text buffer = new Text(); for (Entry<Key,Value> entry : metaBs) { if (tableId.equals(ReplicationSection.getTableId(entry.getKey()))) { ReplicationSection.getFile(entry.getKey(), buffer); wals.add(buffer.toString());