当前位置: 首页>>代码示例>>Java>>正文


Java RpcCallContext类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.ipc.RpcCallContext的典型用法代码示例。如果您正苦于以下问题:Java RpcCallContext类的具体用法?Java RpcCallContext怎么用?Java RpcCallContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RpcCallContext类属于org.apache.hadoop.hbase.ipc包,在下文中一共展示了RpcCallContext类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSize

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * Method to account for the size of retained cells and retained data blocks.
 * @return an object that represents the last referenced block from this response.
 */
Object addSize(RpcCallContext context, Result r, Object lastBlock) {
  if (context != null && !r.isEmpty()) {
    for (Cell c : r.rawCells()) {
      context.incrementResponseCellSize(CellUtil.estimatedHeapSizeOf(c));
      // We're using the last block being the same as the current block as
      // a proxy for pointing to a new block. This won't be exact.
      // If there are multiple gets that bounce back and forth
      // Then it's possible that this will over count the size of
      // referenced blocks. However it's better to over count and
      // use two RPC's than to OOME the RegionServer.
      byte[] valueArray = c.getValueArray();
      if (valueArray != lastBlock) {
        context.incrementResponseBlockSize(valueArray.length);
        lastBlock = valueArray;
      }
    }
  }
  return lastBlock;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:RSRpcServices.java

示例2: closeScanner

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
private void closeScanner(HRegion region, RegionScanner scanner, String scannerName,
    RpcCallContext context) throws IOException {
  if (region.getCoprocessorHost() != null) {
    if (region.getCoprocessorHost().preScannerClose(scanner)) {
      // bypass the actual close.
      return;
    }
  }
  RegionScannerHolder rsh = scanners.remove(scannerName);
  if (rsh != null) {
    if (context != null) {
      context.setCallBack(rsh.closeCallBack);
    } else {
      rsh.s.close();
    }
    if (region.getCoprocessorHost() != null) {
      region.getCoprocessorHost().postScannerClose(scanner);
    }
    closedScanners.put(scannerName, scannerName);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:22,代码来源:RSRpcServices.java

示例3: addSize

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * Method to account for the size of retained cells and retained data blocks.
 * @return an object that represents the last referenced block from this response.
 */
Object addSize(RpcCallContext context, Result r, Object lastBlock) {
  if (context != null && r != null && !r.isEmpty()) {
    for (Cell c : r.rawCells()) {
      context.incrementResponseCellSize(PrivateCellUtil.estimatedSerializedSizeOf(c));

      // Since byte buffers can point all kinds of crazy places it's harder to keep track
      // of which blocks are kept alive by what byte buffer.
      // So we make a guess.
      if (c instanceof ByteBufferExtendedCell) {
        ByteBufferExtendedCell bbCell = (ByteBufferExtendedCell) c;
        ByteBuffer bb = bbCell.getValueByteBuffer();
        if (bb != lastBlock) {
          context.incrementResponseBlockSize(bb.capacity());
          lastBlock = bb;
        }
      } else {
        // We're using the last block being the same as the current block as
        // a proxy for pointing to a new block. This won't be exact.
        // If there are multiple gets that bounce back and forth
        // Then it's possible that this will over count the size of
        // referenced blocks. However it's better to over count and
        // use two rpcs than to OOME the regionserver.
        byte[] valueArray = c.getValueArray();
        if (valueArray != lastBlock) {
          context.incrementResponseBlockSize(valueArray.length);
          lastBlock = valueArray;
        }
      }

    }
  }
  return lastBlock;
}
 
开发者ID:apache,项目名称:hbase,代码行数:38,代码来源:RSRpcServices.java

示例4: checkCallerDisconnect

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
private static void checkCallerDisconnect(HRegion region, String task) throws CallerDisconnectedException{
    RpcCallContext currentCall = RpcServer.getCurrentCall();
    if(currentCall!=null){
        long afterTime =  currentCall.disconnectSince();
        if(afterTime>0){
            throw new CallerDisconnectedException(
                    "Aborting on region " + region.getRegionInfo().getRegionNameAsString() + ", call " +
                            task + " after " + afterTime + " ms, since " +
                            "caller disconnected");
        }
    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:13,代码来源:RegionServerControl.java

示例5: currentClientHasMinimumVersion

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
public static boolean currentClientHasMinimumVersion(int major, int minor) {
  RpcCallContext call = RpcServer.getCurrentCall();
  HBaseProtos.VersionInfo versionInfo = call != null ? call.getClientVersionInfo() : null;
  return hasMinimumVersion(versionInfo, major, minor);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:6,代码来源:VersionInfoUtil.java

示例6: isClientCellBlockSupport

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * @return True if current call supports cellblocks
 */
private boolean isClientCellBlockSupport() {
  RpcCallContext context = RpcServer.getCurrentCall();
  return context != null && context.isClientCellBlockSupported();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:RSRpcServices.java

示例7: isClientCellBlockSupport

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * @return True if current call supports cellblocks
 */
private boolean isClientCellBlockSupport() {
    RpcCallContext context = RpcServer.getCurrentCall();
    return context != null && context.isClientCellBlockSupport();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:8,代码来源:RSRpcServices.java

示例8: isClientCellBlockSupport

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * @return True if current call supports cellblocks
 */
private boolean isClientCellBlockSupport() {
  RpcCallContext context = RpcServer.getCurrentCall();
  return context != null && context.isClientCellBlockSupport();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:8,代码来源:HRegionServer.java

示例9: getCurrentClientVersionInfo

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
/**
 * @return the versionInfo extracted from the current RpcCallContext
 */
private static HBaseProtos.VersionInfo getCurrentClientVersionInfo() {
  return RpcServer.getCurrentCall().map(RpcCallContext::getClientVersionInfo).orElse(null);
}
 
开发者ID:apache,项目名称:hbase,代码行数:7,代码来源:VersionInfoUtil.java

示例10: isClientCellBlockSupport

import org.apache.hadoop.hbase.ipc.RpcCallContext; //导入依赖的package包/类
private boolean isClientCellBlockSupport(RpcCallContext context) {
  return context != null && context.isClientCellBlockSupported();
}
 
开发者ID:apache,项目名称:hbase,代码行数:4,代码来源:RSRpcServices.java


注:本文中的org.apache.hadoop.hbase.ipc.RpcCallContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。