Tabnine Logo
HbaseHandlerMetricsProxy
Code IndexAdd Tabnine to your IDE (free)

How to use
HbaseHandlerMetricsProxy
in
org.apache.hadoop.hbase.thrift

Best Java code snippets using org.apache.hadoop.hbase.thrift.HbaseHandlerMetricsProxy (Showing top 20 results out of 315)

origin: apache/hbase

@Override
protected TProcessor createProcessor() {
 return new THBaseService.Processor<>(HbaseHandlerMetricsProxy
   .newInstance((THBaseService.Iface) hbaseServiceHandler, metrics, conf));
}
origin: apache/hbase

public static THBaseService.Iface newInstance(THBaseService.Iface handler,
  ThriftMetrics metrics,
  Configuration conf) {
 return (THBaseService.Iface) Proxy.newProxyInstance(
   handler.getClass().getClassLoader(),
   new Class[]{THBaseService.Iface.class},
   new HbaseHandlerMetricsProxy(handler, metrics, conf));
}
origin: apache/hbase

@Override
public Object invoke(Object proxy, Method m, Object[] args)
  throws Throwable {
 Object result;
 long start = now();
 try {
  result = m.invoke(handler, args);
 } catch (InvocationTargetException e) {
  metrics.exception(e.getCause());
  throw e.getTargetException();
 } catch (Exception e) {
  metrics.exception(e);
  throw new RuntimeException(
    "unexpected invocation exception: " + e.getMessage());
 } finally {
  long processTime = now() - start;
  metrics.incMethodTime(m.getName(), processTime);
 }
 return result;
}

origin: apache/hbase

protected TProcessor createProcessor() {
 return new Hbase.Processor<>(
   HbaseHandlerMetricsProxy.newInstance((Hbase.Iface) hbaseServiceHandler, metrics, conf));
}
origin: apache/hbase

public static Hbase.Iface newInstance(Hbase.Iface handler,
                   ThriftMetrics metrics,
                   Configuration conf) {
 return (Hbase.Iface) Proxy.newProxyInstance(
   handler.getClass().getClassLoader(),
   new Class[]{Hbase.Iface.class},
   new HbaseHandlerMetricsProxy(handler, metrics, conf));
}
origin: co.cask.hbase/hbase

@Override
public Object invoke(Object proxy, Method m, Object[] args)
  throws Throwable {
 Object result;
 try {
  long start = now();
  result = m.invoke(handler, args);
  int processTime = (int)(now() - start);
  metrics.incMethodTime(m.getName(), processTime);
 } catch (InvocationTargetException e) {
  throw e.getTargetException();
 } catch (Exception e) {
  throw new RuntimeException(
    "unexpected invocation exception: " + e.getMessage());
 }
 return result;
}

origin: apache/hbase

private static Hbase.Iface getHandlerForMetricsTest(ThriftMetrics metrics, Configuration conf)
  throws Exception {
 Hbase.Iface handler = new MySlowHBaseHandler(conf);
 return HbaseHandlerMetricsProxy.newInstance((ThriftHBaseServiceHandler)handler, metrics, conf);
}
origin: com.aliyun.hbase/alihbase-thrift

public static Hbase.Iface newInstance(Hbase.Iface handler,
                   ThriftMetrics metrics,
                   Configuration conf) {
 return (Hbase.Iface) Proxy.newProxyInstance(
   handler.getClass().getClassLoader(),
   new Class[]{Hbase.Iface.class},
   new HbaseHandlerMetricsProxy(handler, metrics, conf));
}
origin: com.aliyun.hbase/alihbase-thrift

@Override
public Object invoke(Object proxy, Method m, Object[] args)
  throws Throwable {
 Object result;
 long start = now();
 try {
  result = m.invoke(handler, args);
 } catch (InvocationTargetException e) {
  metrics.exception(e.getCause());
  throw e.getTargetException();
 } catch (Exception e) {
  metrics.exception(e);
  throw new RuntimeException(
    "unexpected invocation exception: " + e.getMessage());
 } finally {
  long processTime = now() - start;
  metrics.incMethodTime(m.getName(), processTime);
 }
 return result;
}

origin: apache/hbase

@Test
public void testMetrics() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 ThriftMetrics metrics = getMetrics(conf);
 ThriftHBaseServiceHandler hbaseHandler = createHandler();
 THBaseService.Iface handler =
   HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics,  conf);
 byte[] rowName = Bytes.toBytes("testMetrics");
 ByteBuffer table = wrap(tableAname);
 TGet get = new TGet(wrap(rowName));
 assertFalse(handler.exists(table, get));
 List<TColumnValue> columnValues = new ArrayList<>(2);
 columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(valueAname)));
 columnValues.add(new TColumnValue(wrap(familyBname), wrap(qualifierBname),  wrap(valueBname)));
 TPut put = new TPut(wrap(rowName), columnValues);
 put.setColumnValues(columnValues);
 handler.put(table, put);
 assertTrue(handler.exists(table, get));
 metricsHelper.assertCounter("put_num_ops", 1, metrics.getSource());
 metricsHelper.assertCounter("exists_num_ops", 2, metrics.getSource());
}
origin: co.cask.hbase/hbase

public static Hbase.Iface newInstance(Hbase.Iface handler,
                   ThriftMetrics metrics,
                   Configuration conf) {
 return (Hbase.Iface) Proxy.newProxyInstance(
   handler.getClass().getClassLoader(),
   new Class[]{Hbase.Iface.class},
   new HbaseHandlerMetricsProxy(handler, metrics, conf));
}
origin: org.apache.hbase/hbase-thrift

@Override
public Object invoke(Object proxy, Method m, Object[] args)
  throws Throwable {
 Object result;
 long start = now();
 try {
  result = m.invoke(handler, args);
 } catch (InvocationTargetException e) {
  metrics.exception(e.getCause());
  throw e.getTargetException();
 } catch (Exception e) {
  metrics.exception(e);
  throw new RuntimeException(
    "unexpected invocation exception: " + e.getMessage());
 } finally {
  long processTime = now() - start;
  metrics.incMethodTime(m.getName(), processTime);
 }
 return result;
}

origin: apache/hbase

ThriftMetrics metrics = getMetrics(UTIL.getConfiguration());
THBaseService.Iface handler =
  HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics, null);
ByteBuffer tTableName = wrap(tableName.getName());
origin: org.apache.hbase/hbase-thrift

public static Hbase.Iface newInstance(Hbase.Iface handler,
                   ThriftMetrics metrics,
                   Configuration conf) {
 return (Hbase.Iface) Proxy.newProxyInstance(
   handler.getClass().getClassLoader(),
   new Class[]{Hbase.Iface.class},
   new HbaseHandlerMetricsProxy(handler, metrics, conf));
}
origin: apache/hbase

ThriftMetrics metrics = getMetrics(UTIL.getConfiguration());
THBaseService.Iface handler =
  HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics, null);
ByteBuffer tTableName = wrap(tableName.getName());
origin: apache/hbase

  new ThriftHBaseServiceHandler(UTIL.getConfiguration(),
    UserProvider.instantiate(UTIL.getConfiguration()));
Hbase.Iface handler = HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics, conf);
origin: co.cask.hbase/hbase

public ThriftServerRunner(Configuration conf, HBaseHandler handler) {
 this.conf = HBaseConfiguration.create(conf);
 this.listenPort = conf.getInt(PORT_CONF_KEY, DEFAULT_LISTEN_PORT);
 this.metrics = new ThriftMetrics(listenPort, conf, Hbase.Iface.class);
 handler.initMetrics(metrics);
 this.handler = HbaseHandlerMetricsProxy.newInstance(handler, metrics, conf);
}
origin: com.aliyun.hbase/alihbase-thrift

private static Hbase.Iface getHandlerForMetricsTest(ThriftMetrics metrics, Configuration conf)
  throws Exception {
 Hbase.Iface handler = new MySlowHBaseHandler(conf);
 return HbaseHandlerMetricsProxy.newInstance(handler, metrics, conf);
}
origin: org.apache.hbase/hbase-thrift

private static Hbase.Iface getHandlerForMetricsTest(ThriftMetrics metrics, Configuration conf)
  throws Exception {
 Hbase.Iface handler = new MySlowHBaseHandler(conf);
 return HbaseHandlerMetricsProxy.newInstance(handler, metrics, conf);
}
origin: org.apache.hbase/hbase-thrift

this.hbaseHandler = new HBaseHandler(conf, userProvider);
this.hbaseHandler.initMetrics(metrics);
this.handler = HbaseHandlerMetricsProxy.newInstance(hbaseHandler, metrics, conf);
org.apache.hadoop.hbase.thriftHbaseHandlerMetricsProxy

Javadoc

Converts a Hbase.Iface using InvocationHandler so that it reports process time of each call to ThriftMetrics.

Most used methods

  • newInstance
  • <init>
  • now

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • findViewById (Activity)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top plugins for Android Studio
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