@Override public String getInstanceName() { return context.getInstanceName(); }
/** * @param context * the client session for the peer replicant * @return Client to the ReplicationCoordinator service */ public static ReplicationCoordinator.Client getCoordinatorConnectionWithRetry( ClientContext context) throws AccumuloException { requireNonNull(context); for (int attempts = 1; attempts <= 10; attempts++) { ReplicationCoordinator.Client result = getCoordinatorConnection(context); if (result != null) return result; log.debug("Could not get ReplicationCoordinator connection to {}, will retry", context.getInstanceName()); try { Thread.sleep(attempts * 250); } catch (InterruptedException e) { throw new AccumuloException(e); } } throw new AccumuloException( "Timed out trying to communicate with master from " + context.getInstanceName()); }
log.debug("No masters for replication to instance {}", context.getInstanceName()); return null; log.warn("Master found for {} did not have real location {}", context.getInstanceName(), masterThriftService); return null;
public static <T> T executeCoordinatorWithReturn(ClientContext context, ClientExecReturn<T,ReplicationCoordinator.Client> exec) throws AccumuloException, AccumuloSecurityException { ReplicationCoordinator.Client client = null; for (int i = 0; i < 10; i++) { try { client = getCoordinatorConnectionWithRetry(context); return exec.execute(client); } catch (TTransportException tte) { log.debug("ReplicationClient coordinator request failed, retrying ... ", tte); try { Thread.sleep(100); } catch (InterruptedException e) { throw new AccumuloException(e); } } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code, e); } catch (AccumuloException e) { throw e; } catch (Exception e) { throw new AccumuloException(e); } finally { if (client != null) close(client); } } throw new AccumuloException( "Could not connect to ReplicationCoordinator at " + context.getInstanceName()); }
span.data("Batch size (bytes)", Long.toString(sizeLimit)); span.data("File", p.toString()); span.data("Peer instance name", peerContext.getInstanceName()); span.data("Peer tserver", peerTserver.toString()); span.data("Remote table ID", remoteTableId); timeout); } catch (Exception e) { log.error("Caught exception replicating data to {} at {}", peerContext.getInstanceName(), peerTserver, e); throw e;
peerContext.getInstanceName(), ProtobufUtil.toString(finalStatus));