hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch huang <justlo...@gmail.com>
Subject problem in testing coprocessor function
Date Thu, 11 Jul 2013 08:59:34 GMT
i use hbase 0.94.6 ,and i am testing coprocessor function,here is my
testing java code,and i get problem in compile it,anyone can help me? thanks

# javac -cp '/usr/lib/hbase/*' -d test RegionObserverExample.java
RegionObserverExample.java:12: cannot access
com.google.common.collect.ImmutableList
class file for com.google.common.collect.ImmutableList not found
public class RegionObserverExample extends BaseRegionObserver {
       ^
1 error


package org.myorg;
import java.io.IOException;
import java.util.List;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.coprocessor.*;
import org.apache.hadoop.hbase.util.Bytes;
public class RegionObserverExample extends BaseRegionObserver {
        public static final byte[] FIXED_ROW = Bytes.toBytes("@@@GETTIME@
@@");
        public void preGet(final
ObserverContext<RegionCoprocessorEnvironment> e,
            final Get get, final List<KeyValue> results) throws IOException
{
          if (Bytes.equals(get.getRow(), FIXED_ROW)) {
                KeyValue kv = new KeyValue(get.getRow(), FIXED_ROW,
FIXED_ROW,
                  Bytes.toBytes(System.currentTimeMillis()));
                results.add(kv);
          }
        }
}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message