static synchronized Writer getWriter(ClientContext context) { Writer replicationTable = writers.get(context.getCredentials()); if (replicationTable == null) { configureMetadataTable(context, MetadataTable.NAME); replicationTable = new Writer(context, MetadataTable.ID); writers.put(context.getCredentials(), replicationTable); } return replicationTable; }
ReplicationTableUtil.updateFiles(context, extent, logEntry.filename, status);
/** * Write replication ingest entries for each provided file with the given {@link Status}. */ public static void updateFiles(ClientContext context, KeyExtent extent, String file, Status stat) { if (log.isDebugEnabled()) { log.debug("Updating replication status for {} with {} using {}", extent, file, ProtobufUtil.toString(stat)); } // TODO could use batch writer, would need to handle failure and retry like update does - // ACCUMULO-1294 Value v = ProtobufUtil.toValue(stat); update(context, createUpdateMutation(new Path(file), v, extent)); }
static Mutation createUpdateMutation(Path file, Value v, KeyExtent extent) { // Need to normalize the file path so we can assuredly find it again later return createUpdateMutation(new Text(ReplicationSection.getRowPrefix() + file), v, extent); }
/** * Write the given Mutation to the replication table. */ static void update(ClientContext context, Mutation m) { Writer t = getWriter(context); while (true) { try { t.update(m); return; } catch (AccumuloException | TableNotFoundException | ConstraintViolationException | AccumuloSecurityException e) { log.error(e.toString(), e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }
static Mutation createUpdateMutation(Path file, Value v, KeyExtent extent) { // Need to normalize the file path so we can assuredly find it again later return createUpdateMutation(new Text(ReplicationSection.getRowPrefix() + file.toString()), v, extent); }
/** * Write the given Mutation to the replication table. */ static void update(ClientContext context, Mutation m, KeyExtent extent) { Writer t = getWriter(context); while (true) { try { t.update(m); return; } catch (AccumuloException e) { log.error(e.toString(), e); } catch (AccumuloSecurityException e) { log.error(e.toString(), e); } catch (ConstraintViolationException e) { log.error(e.toString(), e); } catch (TableNotFoundException e) { log.error(e.toString(), e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }
synchronized static Writer getWriter(ClientContext context) { Writer replicationTable = writers.get(context.getCredentials()); if (replicationTable == null) { Connector conn; try { conn = context.getConnector(); } catch (AccumuloException | AccumuloSecurityException e) { throw new RuntimeException(e); } configureMetadataTable(conn, MetadataTable.NAME); replicationTable = new Writer(context, MetadataTable.ID); writers.put(context.getCredentials(), replicationTable); } return replicationTable; }
+ copy.getFileName()); ReplicationTableUtil.updateFiles(tserver.getContext(), commitSession.getExtent(), copy.getFileName(), status);
/** * Write replication ingest entries for each provided file with the given {@link Status}. */ public static void updateFiles(ClientContext context, KeyExtent extent, String file, Status stat) { if (log.isDebugEnabled()) { log.debug("Updating replication status for " + extent + " with " + file + " using " + ProtobufUtil.toString(stat)); } // TODO could use batch writer, would need to handle failure and retry like update does - // ACCUMULO-1294 Value v = ProtobufUtil.toValue(stat); update(context, createUpdateMutation(new Path(file), v, extent), extent); }
String sourceTable = testName.getMethodName(); conn.tableOperations().create(sourceTable); ReplicationTableUtil.configureMetadataTable(conn, sourceTable);
ReplicationTableUtil.updateFiles(tablet.getContext(), tablet.getExtent(), logFile, StatusUtil.openWithUnknownLength());
String sourceTable = testName.getMethodName(); conn.tableOperations().create(sourceTable); ReplicationTableUtil.configureMetadataTable(conn, sourceTable);
log.debug("Writing updated status to metadata table for {} {}", logEntry.filename, ProtobufUtil.toString(status)); ReplicationTableUtil.updateFiles(tabletServer.getContext(), extent, logEntry.filename, status);
String sourceTable = testName.getMethodName(); conn.tableOperations().create(sourceTable); ReplicationTableUtil.configureMetadataTable(conn, sourceTable);
ReplicationTableUtil.updateFiles(context, extent, logEntry.filename, status);
String sourceTable = testName.getMethodName(); conn.tableOperations().create(sourceTable); ReplicationTableUtil.configureMetadataTable(conn, sourceTable);
+ copy.getFileName()); ReplicationTableUtil.updateFiles(tserver, commitSession.getExtent(), copy.getFileName(), status);
String sourceTable = testName.getMethodName(); conn.tableOperations().create(sourceTable); ReplicationTableUtil.configureMetadataTable(conn, sourceTable);
ReplicationTableUtil.updateFiles(tablet.getTabletServer(), tablet.getExtent(), logFile, StatusUtil.openWithUnknownLength());