Tabnine Logo
ReplicationProtbufUtil.replicateWALEntry
Code IndexAdd Tabnine 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)

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

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now