com.google.cloud.bigtable.hbase
Class BigtableBufferedMutator
- java.lang.Object
-
- com.google.cloud.bigtable.hbase.BigtableBufferedMutator
-
- All Implemented Interfaces:
- Closeable, AutoCloseable, BufferedMutator
public class BigtableBufferedMutator extends Object implements BufferedMutator
Bigtable'sBufferedMutator
implementation.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
BufferedMutator.ExceptionListener
-
-
Field Summary
Fields Modifier and Type Field and Description protected static Logger
LOG
-
Fields inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
CLASSNAME_KEY, MIN_WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS
-
-
Constructor Summary
Constructors Constructor and Description BigtableBufferedMutator(HBaseRequestAdapter adapter, org.apache.hadoop.conf.Configuration configuration, BigtableSession session, BufferedMutator.ExceptionListener listener)
Constructor for BigtableBufferedMutator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
void
flush()
org.apache.hadoop.conf.Configuration
getConfiguration()
TableName
getName()
long
getWriteBufferSize()
boolean
hasInflightRequests()
hasInflightRequests.void
mutate(List<? extends Mutation> mutations)
void
mutate(Mutation mutation)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
disableWriteBufferPeriodicFlush, getWriteBufferPeriodicFlushTimeoutMs, getWriteBufferPeriodicFlushTimerTickMs, setOperationTimeout, setRpcTimeout, setWriteBufferPeriodicFlush, setWriteBufferPeriodicFlush
-
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
-
Constructor Detail
-
BigtableBufferedMutator
public BigtableBufferedMutator(HBaseRequestAdapter adapter, org.apache.hadoop.conf.Configuration configuration, BigtableSession session, BufferedMutator.ExceptionListener listener)
Constructor for BigtableBufferedMutator.- Parameters:
adapter
- Converts HBase objects to Bigtable protosconfiguration
- For Additional configuration. TODO: move this to optionslistener
- Handles exceptions. By default, it just throws the exception.session
- aBigtableSession
object.
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBufferedMutator
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceBufferedMutator
- Throws:
IOException
-
getConfiguration
public org.apache.hadoop.conf.Configuration getConfiguration()
- Specified by:
getConfiguration
in interfaceBufferedMutator
-
getName
public TableName getName()
- Specified by:
getName
in interfaceBufferedMutator
-
getWriteBufferSize
public long getWriteBufferSize()
- Specified by:
getWriteBufferSize
in interfaceBufferedMutator
-
mutate
public void mutate(List<? extends Mutation> mutations) throws IOException
- Specified by:
mutate
in interfaceBufferedMutator
- Throws:
IOException
-
mutate
public void mutate(Mutation mutation) throws IOException
Being a Mutation. This method will block if either of the following are true: 1) There are more than
maxInflightRpcs
RPCs in flight 2) There are more thangetWriteBufferSize()
bytes pending- Specified by:
mutate
in interfaceBufferedMutator
- Throws:
IOException
-
hasInflightRequests
public boolean hasInflightRequests()
hasInflightRequests.- Returns:
- a boolean.
-
-