hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "神之疯神" <77231...@qq.com>
Subject Timeout processing put inside observer with over 10 threads.
Date Thu, 03 Jul 2014 01:22:08 GMT
In my observer prePut method, I intercept the origin put then modify rowkey  and copy everything
else. I tried different way to get HTableInterface to find  out the most efficient one.
 These codes are the one went wrong.
private Configuration conf=null;
private HConnection connection =  null;
public void  postOpen(ObserverContext<RegionCoprocessorEnvironment> e)  {
  if(conf==null)    conf=e.getEnvironment().getConfiguration();
   try {
    if(connection==null) connection=HConnectionManager.createConnection(conf);
  }  catch (Exception e1)  {
public void  prePut(ObserverContext<RegionCoprocessorEnvironment> e,Put put, WALEdit
 edit, boolean writeToWAL) throws IOException {
  String  tn=e.getEnvironment().getRegion().getTableDesc().getNameAsString();
  String  rowkey = Bytes.toString(put.getRow());
  l.debug("rowkey="+rowkey);    ...
   HTableInterface tableA = connection.getTable("tablename");
   log.debug("put start at+"+time);
  log.debug("put stop  at+"+System.currentTimeMillis());
 The log says all thread simply stopped after excuted put method, till  timeout.
 Can anyone tell me what have happened?
 The same style works perfectly as client. 9 threads is ok when each thread  performs less
than 100 puts ,and same thing happens when I pushed further.‍

  • Unnamed multipart/mixed (inline, 8-Bit, 0 bytes)
View raw message