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

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

Best Java code snippets using org.apache.hadoop.hbase.protobuf.ReplicationProtbufUtil (Showing top 15 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

/**
 * Create a new ReplicateWALEntryRequest from a list of WAL entries
 *
 * @param entries the WAL entries to be replicated
 * @return a pair of ReplicateWALEntryRequest and a CellScanner over all the WALEdit values
 * found.
 */
public static Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner>
  buildReplicateWALEntryRequest(final Entry[] entries) throws IOException {
 return buildReplicateWALEntryRequest(entries, null, null, null, null);
}
origin: apache/hbase

all.add(b);
all.add(c);
CellScanner scanner = ReplicationProtbufUtil.getCellScanner(all, 0);
testAdvancetHasSameRow(scanner, akv);
origin: apache/hbase

getCellScanner(allCells, size));
origin: org.apache.hbase/hbase-server

all.add(b);
all.add(c);
CellScanner scanner = ReplicationProtbufUtil.getCellScanner(all, 0);
testAdvancetHasSameRow(scanner, akv);
origin: apache/hbase

private void replayWAL(String wal) throws IOException {
 try (Reader reader = getReader(wal)) {
  List<Entry> entries = readWALEntries(reader);
  while (!entries.isEmpty()) {
   Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner> pair = ReplicationProtbufUtil
     .buildReplicateWALEntryRequest(entries.toArray(new Entry[entries.size()]));
   ReplicateWALEntryRequest request = pair.getFirst();
   rs.getReplicationSinkService().replicateLogEntries(request.getEntryList(),
     pair.getSecond(), request.getReplicationClusterId(),
     request.getSourceBaseNamespaceDirPath(), request.getSourceHFileArchiveDirPath());
   // Read next entries.
   entries = readWALEntries(reader);
  }
 }
}
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

getCellScanner(allCells, size));
origin: apache/hbase

  ReplicationProtbufUtil.buildReplicateWALEntryRequest(entriesArray, location
    .getRegionInfo().getEncodedNameAsBytes(), null, null, null);
controller.setCellScanner(p.getSecond());
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;
 }
}
origin: apache/hbase

/**
 * A helper to replicate a list of WAL entries using admin protocol.
 * @param admin Admin service
 * @param entries Array of WAL entries to be replicated
 * @param replicationClusterId Id which will uniquely identify source cluster FS client
 *          configurations in the replication configuration directory
 * @param sourceBaseNamespaceDir Path to source cluster base namespace directory
 * @param sourceHFileArchiveDir Path to the source cluster hfile archive directory
 * @throws java.io.IOException
 */
public static void replicateWALEntry(final AdminService.BlockingInterface admin,
  final Entry[] entries, String replicationClusterId, Path sourceBaseNamespaceDir,
  Path sourceHFileArchiveDir) throws IOException {
 Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner> p =
   buildReplicateWALEntryRequest(entries, null, replicationClusterId, sourceBaseNamespaceDir,
    sourceHFileArchiveDir);
 HBaseRpcController controller = new HBaseRpcControllerImpl(p.getSecond());
 try {
  admin.replicateWALEntry(controller, p.getFirst());
 } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException e) {
  throw ProtobufUtil.getServiceException(e);
 }
}
origin: harbby/presto-connectors

/**
 * Create a new ReplicateWALEntryRequest from a list of WAL entries
 *
 * @param entries the WAL entries to be replicated
 * @return a pair of ReplicateWALEntryRequest and a CellScanner over all the WALEdit values
 * found.
 */
public static Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner>
  buildReplicateWALEntryRequest(final Entry[] entries) {
 // Accumulate all the Cells seen in here.
 return buildReplicateWALEntryRequest(entries, null);
}
origin: harbby/presto-connectors

private void replayToServer(HRegionInfo regionInfo, List<Entry> entries)
  throws IOException, ServiceException {
 if (entries.isEmpty()) return;
 Entry[] entriesArray = new Entry[entries.size()];
 entriesArray = entries.toArray(entriesArray);
 AdminService.BlockingInterface remoteSvr = conn.getAdmin(getLocation().getServerName());
 Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner> p =
   ReplicationProtbufUtil.buildReplicateWALEntryRequest(entriesArray);
 PayloadCarryingRpcController controller = rpcControllerFactory.newController(p.getSecond());
 try {
  remoteSvr.replay(controller, p.getFirst());
 } catch (ServiceException se) {
  throw ProtobufUtil.getRemoteException(se);
 }
}
origin: harbby/presto-connectors

/**
 * A helper to replicate a list of WAL entries using admin protocol.
 *
 * @param admin
 * @param entries
 * @throws java.io.IOException
 */
public static void replicateWALEntry(final AdminService.BlockingInterface admin,
  final Entry[] entries) throws IOException {
 Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner> p =
  buildReplicateWALEntryRequest(entries, null);
 PayloadCarryingRpcController controller = new PayloadCarryingRpcController(p.getSecond());
 try {
  admin.replicateWALEntry(controller, p.getFirst());
 } catch (ServiceException se) {
  throw ProtobufUtil.getRemoteException(se);
 }
}
origin: harbby/presto-connectors

  ReplicationProtbufUtil.buildReplicateWALEntryRequest(
   entriesArray, location.getRegionInfo().getEncodedNameAsBytes());
try {
org.apache.hadoop.hbase.protobufReplicationProtbufUtil

Most used methods

  • getCellScanner
  • replicateWALEntry
    A helper to replicate a list of WAL entries using admin protocol.
  • buildReplicateWALEntryRequest
    Create a new ReplicateWALEntryRequest from a list of WAL entries

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Table (org.hibernate.mapping)
    A relational table
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