private void updateMetrics(Call result) { if (result == null) { return; } metrics.incTimeInQueue(result.timeInQueue()); metrics.setCallQueueLen(this.size()); }
@Override public List<TRowResult> getRow(ByteBuffer tableName, ByteBuffer row, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { return getRowWithColumnsTs(tableName, row, null, HConstants.LATEST_TIMESTAMP, attributes); }
@Override public MetricsThriftServerSource createThriftOneSource() { if (FactoryStorage.INSTANCE.thriftOne == null) { FactoryStorage.INSTANCE.thriftOne = new MetricsThriftServerSourceImpl(METRICS_NAME, METRICS_DESCRIPTION, THRIFT_ONE_METRICS_CONTEXT, THRIFT_ONE_JMX_CONTEXT); } return FactoryStorage.INSTANCE.thriftOne; }
private static ThriftMetrics getMetrics(Configuration conf) throws Exception { ThriftMetrics m = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO); m.getSource().init(); //Clear all the metrics return m; }
private static Hbase.Iface getHandlerForMetricsTest(ThriftMetrics metrics, Configuration conf) throws Exception { Hbase.Iface handler = new MySlowHBaseHandler(conf); return HbaseHandlerMetricsProxy.newInstance((ThriftHBaseServiceHandler)handler, metrics, conf); }
@Override public void run() { TBoundedThreadPoolServer.this.stop(); } });
public HThreadedSelectorServerArgs( TNonblockingServerTransport transport, Configuration conf) { super(transport); readConf(conf); }
/** * This utility method creates a list of Thrift TRowResult "struct" based on * an array of Hbase RowResult objects. The empty list is returned if the input is * null. * * @param in * Array of Hbase RowResult objects * @return Thrift TRowResult array */ static public List<TRowResult> rowResultFromHBase(Result[] in) { return rowResultFromHBase(in, false); }
@Override public Void run() throws Exception { client.run(); return null; } });
public THBaseThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory,ThriftMetrics metrics) { super(corePoolSize, maxPoolSize, keepAliveTime, unit, workQueue); if (threadFactory != null) { setThreadFactory(threadFactory); } this.metrics = metrics; }
/** * Run without any command line arguments * @return exit code * @throws Exception exception */ public int run() throws Exception { return run(null); }
@Override public void mutateRow(ByteBuffer tableName, ByteBuffer row, List<Mutation> mutations, Map<ByteBuffer, ByteBuffer> attributes) throws IOError, IllegalArgument { mutateRowTs(tableName, row, mutations, HConstants.LATEST_TIMESTAMP, attributes); }
private void printRow(List<TRowResult> rows) { for (TRowResult rowResult : rows) { printRow(rowResult); } }
@Override public void mutateRows(ByteBuffer tableName, List<BatchMutation> rowBatches, Map<ByteBuffer, ByteBuffer> attributes) throws IOError, IllegalArgument, TException { mutateRowsTs(tableName, rowBatches, HConstants.LATEST_TIMESTAMP, attributes); }
@Override public Void run() throws Exception { client.run(); return null; } });
@Override public List<TRowResult> getRows(ByteBuffer tableName, List<ByteBuffer> rows, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { return getRowsWithColumnsTs(tableName, rows, null, HConstants.LATEST_TIMESTAMP, attributes); }
@Override public List<TRowResult> getRowWithColumns(ByteBuffer tableName, ByteBuffer row, List<ByteBuffer> columns, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { return getRowWithColumnsTs(tableName, row, columns, HConstants.LATEST_TIMESTAMP, attributes); }
@Override public MetricsThriftServerSource createThriftTwoSource() { if (FactoryStorage.INSTANCE.thriftTwo == null) { FactoryStorage.INSTANCE.thriftTwo = new MetricsThriftServerSourceImpl(METRICS_NAME, METRICS_DESCRIPTION, THRIFT_TWO_METRICS_CONTEXT, THRIFT_TWO_JMX_CONTEXT); } return FactoryStorage.INSTANCE.thriftTwo; } }
@Override public List<TRowResult> getRowsWithColumns(ByteBuffer tableName, List<ByteBuffer> rows, List<ByteBuffer> columns, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { return getRowsWithColumnsTs(tableName, rows, columns, HConstants.LATEST_TIMESTAMP, attributes); }
@Override public List<TRowResult> getRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { return getRowWithColumnsTs(tableName, row, null, timestamp, attributes); }