Java Code Examples for org.apache.hadoop.hbase.protobuf.generated.AdminProtos#ReplicateWALEntryResponse

The following examples show how to use org.apache.hadoop.hbase.protobuf.generated.AdminProtos#ReplicateWALEntryResponse . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseHRegionServer.java    From DataLink with Apache License 2.0 4 votes vote down vote up
@Override
public AdminProtos.ReplicateWALEntryResponse replicateWALEntry(RpcController controller, AdminProtos.ReplicateWALEntryRequest request) throws ServiceException {
    throw new UnsupportedOperationException("No need to support.");
}
 
Example 2
Source File: BaseHRegionServer.java    From DataLink with Apache License 2.0 4 votes vote down vote up
@Override
public AdminProtos.ReplicateWALEntryResponse replay(RpcController controller, AdminProtos.ReplicateWALEntryRequest request) throws ServiceException {
    throw new UnsupportedOperationException("No need to support.");
}
 
Example 3
Source File: BaseHRegionServer.java    From hbase-indexer with Apache License 2.0 4 votes vote down vote up
@Override
public AdminProtos.ReplicateWALEntryResponse replicateWALEntry(RpcController rpcController, AdminProtos.ReplicateWALEntryRequest replicateWALEntryRequest) throws ServiceException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example 4
Source File: BaseHRegionServer.java    From hbase-indexer with Apache License 2.0 4 votes vote down vote up
@Override
public AdminProtos.ReplicateWALEntryResponse replay(final RpcController controller, final AdminProtos.ReplicateWALEntryRequest request) throws ServiceException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example 5
Source File: SepConsumer.java    From hbase-indexer with Apache License 2.0 4 votes vote down vote up
@Override
public AdminProtos.ReplicateWALEntryResponse replicateWALEntry(final RpcController controller,
        final AdminProtos.ReplicateWALEntryRequest request) throws ServiceException {
    try {

        // TODO Recording of last processed timestamp won't work if two batches of log entries are sent out of order
        long lastProcessedTimestamp = -1;

        SepEventExecutor eventExecutor = new SepEventExecutor(listener, executors, 100, sepMetrics);

        List<AdminProtos.WALEntry> entries = request.getEntryList();
        CellScanner cells = ((PayloadCarryingRpcController)controller).cellScanner();

        for (final AdminProtos.WALEntry entry : entries) {
            TableName tableName = (entry.getKey().getWriteTime() < subscriptionTimestamp) ? null :
                    TableName.valueOf(entry.getKey().getTableName().toByteArray());
            Multimap<ByteBuffer, Cell> keyValuesPerRowKey = ArrayListMultimap.create();
            final Map<ByteBuffer, byte[]> payloadPerRowKey = Maps.newHashMap();
            int count = entry.getAssociatedCellCount();
            for (int i = 0; i < count; i++) {
                if (!cells.advance()) {
                    throw new ArrayIndexOutOfBoundsException("Expected=" + count + ", index=" + i);
                }

                // this signals to us that we simply need to skip over count of cells
                if (tableName == null) {
                    continue;
                }

                Cell cell = cells.current();
                ByteBuffer rowKey = ByteBuffer.wrap(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
                byte[] payload;
                KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
                if (payloadExtractor != null && (payload = payloadExtractor.extractPayload(tableName.toBytes(), kv)) != null) {
                    if (payloadPerRowKey.containsKey(rowKey)) {
                        log.error("Multiple payloads encountered for row " + Bytes.toStringBinary(rowKey)
                                + ", choosing " + Bytes.toStringBinary(payloadPerRowKey.get(rowKey)));
                    } else {
                        payloadPerRowKey.put(rowKey, payload);
                    }
                }
                keyValuesPerRowKey.put(rowKey, kv);
            }

            for (final ByteBuffer rowKeyBuffer : keyValuesPerRowKey.keySet()) {
                final List<Cell> keyValues = (List<Cell>) keyValuesPerRowKey.get(rowKeyBuffer);

                final SepEvent sepEvent = new SepEvent(tableName.toBytes(), CellUtil.cloneRow(keyValues.get(0)), keyValues,
                        payloadPerRowKey.get(rowKeyBuffer));
                eventExecutor.scheduleSepEvent(sepEvent);
                lastProcessedTimestamp = Math.max(lastProcessedTimestamp, entry.getKey().getWriteTime());
            }

        }
        List<Future<?>> futures = eventExecutor.flush();
        waitOnSepEventCompletion(futures);

        if (lastProcessedTimestamp > 0) {
            sepMetrics.reportSepTimestamp(lastProcessedTimestamp);
        }
        return AdminProtos.ReplicateWALEntryResponse.newBuilder().build();
    } catch (IOException ie) {
        throw new ServiceException(ie);
    }
}
 
Example 6
Source File: BaseHRegionServer.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
public AdminProtos.ReplicateWALEntryResponse replicateWALEntry(RpcController rpcController, AdminProtos.ReplicateWALEntryRequest replicateWALEntryRequest) throws ServiceException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example 7
Source File: BaseHRegionServer.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
public AdminProtos.ReplicateWALEntryResponse replay(RpcController controller, AdminProtos.ReplicateWALEntryRequest request) throws ServiceException {
    throw new UnsupportedOperationException("Not implemented");
}