HBASE-5824 HRegion.incrementColumnValue is not used in trunk

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1328142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-19 22:49:30 +00:00
parent f9fb38e31c
commit 0b30494edb
2 changed files with 31 additions and 12 deletions

View File

@ -829,21 +829,39 @@ public class HTable implements HTableInterface {
}
private void doPut(final List<Put> puts) throws IOException {
int n = 0;
for (Put put : puts) {
if (autoFlush && puts.size() == 1) {
final Put put = puts.get(0);
validatePut(put);
writeBuffer.add(put);
currentWriteBufferSize += put.heapSize();
// we need to periodically see if the writebuffer is full instead of waiting until the end of the List
n++;
if (n % DOPUT_WB_CHECK == 0 && currentWriteBufferSize > writeBufferSize) {
new ServerCallable<Void>(connection, tableName, put.getRow(),
operationTimeout) {
public Void call() throws IOException {
try {
MutateRequest request = RequestConverter.buildMutateRequest(
location.getRegionInfo().getRegionName(), put);
server.mutate(null, request);
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
return null;
}
}.withRetries();
} else {
int n = 0;
for (Put put : puts) {
validatePut(put);
writeBuffer.add(put);
currentWriteBufferSize += put.heapSize();
// we need to periodically see if the writebuffer is full instead of waiting until the end of the List
n++;
if (n % DOPUT_WB_CHECK == 0 && currentWriteBufferSize > writeBufferSize) {
flushCommits();
}
}
if (autoFlush || currentWriteBufferSize > writeBufferSize) {
flushCommits();
}
}
if (autoFlush || currentWriteBufferSize > writeBufferSize) {
flushCommits();
}
}
/**

View File

@ -44,7 +44,6 @@ import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
@ -4634,7 +4633,9 @@ public class HRegion implements HeapSize { // , Writable{
* @param writeToWAL
* @return The new value.
* @throws IOException
* @deprecated use {@link #increment(Increment, Integer, boolean)}
*/
@Deprecated
public long incrementColumnValue(byte [] row, byte [] family,
byte [] qualifier, long amount, boolean writeToWAL)
throws IOException {