The problem is caused by the code, as I create the configuration by
myself. The correct way is to use getConfiguration() method.

regards!

Yong

On Sat, Nov 10, 2012 at 4:12 PM, ramkrishna vasudevan
<ramkrishna.s.vasude...@gmail.com> wrote:
> Sorry i am not very sure if there is any link between the coprocessor and
> region not online.
> Pls check if your META region is online.
>
> Regards
> ram
>
> On Sat, Nov 10, 2012 at 8:37 PM, yonghu <yongyong...@gmail.com> wrote:
>
>> Dear All,
>>
>> I used hbase 0.94.1 and implemented the test example of WAL trigger like:
>>
>> public class WalTrigger extends BaseRegionObserver implements WALObserver{
>>
>>         public boolean
>> preWALWrite(ObserverContext<WALCoprocessorEnvironment>
>> ctx, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws
>> IOException{
>>                 Configuration conf = new Configuration();
>>                 String key = logKey.toString();
>>                 String value = logEdit.toString();
>>                 String logRes = key + value;
>>                 HTable table = new HTable(conf,"log");
>>                 Put put = new Put(Bytes.toBytes(key));
>>                 put.add(Bytes.toBytes("logEntry"), null,
>> Bytes.toBytes(value));
>>                 table.put(put);
>>                 return true;
>>         }
>>         public void postWALWrite(ObserverContext<WALCoprocessorEnvironment>
>> ctx, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws
>> IOException{
>>
>>         }
>> }
>>
>> However, when I inserted the tuples in HBase, it returns Exception in
>> thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException:
>> Failed after attempts=10, exceptions:
>> Sat Nov 10 15:58:14 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:15 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:16 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:17 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:19 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:21 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:25 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:29 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:37 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>> Sat Nov 10 15:58:54 CET 2012,
>> org.apache.hadoop.hbase.client.ScannerCallable@1ff92f5,
>> org.apache.hadoop.hbase.NotServingRegionException:
>> org.apache.hadoop.hbase.NotServingRegionException: Region is not
>> online: .META.,,1
>>
>>         at
>> org.apache.hadoop.hbase.client.ServerCallable.withRetries(ServerCallable.java:183)
>>         at
>> org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:205)
>>         at
>> org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:120)
>>         at
>> org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:626)
>>         at
>> org.apache.hadoop.hbase.catalog.MetaReader.fullScan(MetaReader.java:707)
>>         at
>> org.apache.hadoop.hbase.catalog.MetaReader.fullScan(MetaReader.java:183)
>>         at
>> org.apache.hadoop.hbase.catalog.MetaReader.tableExists(MetaReader.java:448)
>>         at
>> org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:233)
>>         at
>> datageneraion.HBaseDataGenerator.createTable(HBaseDataGenerator.java:24)
>>         at
>> datageneraion.HBaseDataGenerator.main(HBaseDataGenerator.java:76)
>>
>> By the way, I set in the hbase-site.xml file
>>
>> <property>
>> <name>hbase.coprocessor.wal.classes</name>
>> <value>yonghu.waltrigger.WalTrigger</value>
>>
>> Can anyone give me some advices?
>>
>> Thanks!
>>
>> Yong
>>

Reply via email to