Codota Logo
ReplicationProtbufUtil.replicateWALEntry
Code IndexAdd Codota to your IDE (free)

How to use
replicateWALEntry
method
in
org.apache.hadoop.hbase.protobuf.ReplicationProtbufUtil

Best Java code snippets using org.apache.hadoop.hbase.protobuf.ReplicationProtbufUtil.replicateWALEntry (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: apache/hbase

@VisibleForTesting
protected int replicateEntries(List<Entry> entries, int batchIndex) throws IOException {
 SinkPeer sinkPeer = null;
 try {
  int entriesHashCode = System.identityHashCode(entries);
  if (LOG.isTraceEnabled()) {
   long size = entries.stream().mapToLong(this::getEstimatedEntrySize).sum();
   LOG.trace("Replicating batch {} of {} entries with total size {} bytes to {}",
    entriesHashCode, entries.size(), size, replicationClusterId);
  }
  sinkPeer = replicationSinkMgr.getReplicationSink();
  BlockingInterface rrs = sinkPeer.getRegionServer();
  try {
   ReplicationProtbufUtil.replicateWALEntry(rrs, entries.toArray(new Entry[entries.size()]),
    replicationClusterId, baseNamespaceDir, hfileArchiveDir);
   LOG.trace("Completed replicating batch {}", entriesHashCode);
  } catch (IOException e) {
   LOG.trace("Failed replicating batch {}", entriesHashCode, e);
   throw e;
  }
  replicationSinkMgr.reportSinkSuccess(sinkPeer);
 } catch (IOException ioe) {
  if (sinkPeer != null) {
   replicationSinkMgr.reportBadSink(sinkPeer);
  }
  throw ioe;
 }
 return batchIndex;
}
origin: apache/hbase

protected final void verifyReplicationRequestRejection(HBaseTestingUtility utility,
  boolean expectedRejection) throws Exception {
 HRegionServer regionServer = utility.getRSForFirstRegionInTable(TABLE_NAME);
 ClusterConnection connection = regionServer.getClusterConnection();
 Entry[] entries = new Entry[10];
 for (int i = 0; i < entries.length; i++) {
  entries[i] =
   new Entry(new WALKeyImpl(HConstants.EMPTY_BYTE_ARRAY, TABLE_NAME, 0), new WALEdit());
 }
 if (!expectedRejection) {
  ReplicationProtbufUtil.replicateWALEntry(connection.getAdmin(regionServer.getServerName()),
   entries, null, null, null);
 } else {
  try {
   ReplicationProtbufUtil.replicateWALEntry(connection.getAdmin(regionServer.getServerName()),
    entries, null, null, null);
   fail("Should throw IOException when sync-replication state is in A or DA");
  } catch (DoNotRetryIOException e) {
   assertTrue(e.getMessage().contains("Reject to apply to sink cluster"));
   assertTrue(e.getMessage().contains(TABLE_NAME.toString()));
  }
 }
}
origin: harbby/presto-connectors

@Override
public Integer call() throws IOException {
 SinkPeer sinkPeer = null;
 try {
  sinkPeer = replicationSinkMgr.getReplicationSink();
  BlockingInterface rrs = sinkPeer.getRegionServer();
  ReplicationProtbufUtil.replicateWALEntry(rrs,
    entries.toArray(new Entry[entries.size()]));
  replicationSinkMgr.reportSinkSuccess(sinkPeer);
  return ordinal;
 } catch (IOException ioe) {
  if (sinkPeer != null) {
   replicationSinkMgr.reportBadSink(sinkPeer);
  }
  throw ioe;
 }
}
org.apache.hadoop.hbase.protobufReplicationProtbufUtilreplicateWALEntry

Javadoc

A helper to replicate a list of WAL entries using admin protocol.

Popular methods of ReplicationProtbufUtil

  • getCellScanner
  • buildReplicateWALEntryRequest
    Create a new ReplicateWALEntryRequest from a list of WAL entries

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now