HBASE-2245 Unnecessary call to syncWal(region); in HRegionServer
(Benoit Sigoure via JD) HBASE-2246 Add a getConfiguration method to HTableInterface (Benoit Sigoure via JD) git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@917783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dc579e5972
commit
ee54d203e9
|
@ -395,6 +395,10 @@ Release 0.21.0 - Unreleased
|
||||||
HBASE-2262 ZKW.ensureExists should check for existence
|
HBASE-2262 ZKW.ensureExists should check for existence
|
||||||
HBASE-2264 Adjust the contrib apps to the Maven project layout
|
HBASE-2264 Adjust the contrib apps to the Maven project layout
|
||||||
(Lars Francke via Lars George)
|
(Lars Francke via Lars George)
|
||||||
|
HBASE-2245 Unnecessary call to syncWal(region); in HRegionServer
|
||||||
|
(Benoit Sigoure via JD)
|
||||||
|
HBASE-2246 Add a getConfiguration method to HTableInterface
|
||||||
|
(Benoit Sigoure via JD)
|
||||||
|
|
||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
HBASE-1961 HBase EC2 scripts
|
HBASE-1961 HBase EC2 scripts
|
||||||
|
|
|
@ -155,6 +155,10 @@ public class HTable implements HTableInterface {
|
||||||
new DaemonThreadFactory());
|
new DaemonThreadFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Configuration getConfiguration() {
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Might want to change this to public, would be nice if the number
|
* TODO Might want to change this to public, would be nice if the number
|
||||||
* of threads would automatically change when servers were added and removed
|
* of threads would automatically change when servers were added and removed
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.hadoop.hbase.client;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,6 +38,13 @@ public interface HTableInterface {
|
||||||
*/
|
*/
|
||||||
byte[] getTableName();
|
byte[] getTableName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the configuration of this instance.
|
||||||
|
*
|
||||||
|
* @return The configuration.
|
||||||
|
*/
|
||||||
|
Configuration getConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the table descriptor for this table.
|
* Gets the table descriptor for this table.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1684,9 +1684,12 @@ public class HRegionServer implements HConstants, HRegionInterface,
|
||||||
if (!region.getRegionInfo().isMetaTable()) {
|
if (!region.getRegionInfo().isMetaTable()) {
|
||||||
this.cacheFlusher.reclaimMemStoreMemory();
|
this.cacheFlusher.reclaimMemStoreMemory();
|
||||||
}
|
}
|
||||||
region.put(put, getLockFromId(put.getLockId()));
|
boolean writeToWAL = put.getWriteToWAL();
|
||||||
|
region.put(put, getLockFromId(put.getLockId()), writeToWAL);
|
||||||
|
|
||||||
this.syncWal(region);
|
if (writeToWAL) {
|
||||||
|
this.syncWal(region);
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
throw convertThrowableToIOE(cleanup(t));
|
throw convertThrowableToIOE(cleanup(t));
|
||||||
}
|
}
|
||||||
|
@ -1698,6 +1701,7 @@ public class HRegionServer implements HConstants, HRegionInterface,
|
||||||
int i = 0;
|
int i = 0;
|
||||||
checkOpen();
|
checkOpen();
|
||||||
HRegion region = null;
|
HRegion region = null;
|
||||||
|
boolean writeToWAL = true;
|
||||||
try {
|
try {
|
||||||
region = getRegion(regionName);
|
region = getRegion(regionName);
|
||||||
if (!region.getRegionInfo().isMetaTable()) {
|
if (!region.getRegionInfo().isMetaTable()) {
|
||||||
|
@ -1706,6 +1710,7 @@ public class HRegionServer implements HConstants, HRegionInterface,
|
||||||
for (i = 0; i < puts.length; i++) {
|
for (i = 0; i < puts.length; i++) {
|
||||||
this.requestCount.incrementAndGet();
|
this.requestCount.incrementAndGet();
|
||||||
Integer lock = getLockFromId(puts[i].getLockId());
|
Integer lock = getLockFromId(puts[i].getLockId());
|
||||||
|
writeToWAL &= puts[i].getWriteToWAL();
|
||||||
region.put(puts[i], lock);
|
region.put(puts[i], lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1720,7 +1725,9 @@ public class HRegionServer implements HConstants, HRegionInterface,
|
||||||
}
|
}
|
||||||
// All have been processed successfully.
|
// All have been processed successfully.
|
||||||
|
|
||||||
this.syncWal(region);
|
if (writeToWAL) {
|
||||||
|
this.syncWal(region);
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2378,7 +2385,9 @@ public class HRegionServer implements HConstants, HRegionInterface,
|
||||||
long retval = region.incrementColumnValue(row, family, qualifier, amount,
|
long retval = region.incrementColumnValue(row, family, qualifier, amount,
|
||||||
writeToWAL);
|
writeToWAL);
|
||||||
|
|
||||||
syncWal(region);
|
if (writeToWAL) {
|
||||||
|
syncWal(region);
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.client;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertSame;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
@ -106,6 +107,19 @@ public class TestFromClientSide {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that getConfiguration returns the same Configuration object used
|
||||||
|
* to create the HTable instance.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testGetConfiguration() throws Exception {
|
||||||
|
byte[] TABLE = Bytes.toBytes("testGetConfiguration");
|
||||||
|
byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") };
|
||||||
|
Configuration conf = TEST_UTIL.getConfiguration();
|
||||||
|
HTable table = TEST_UTIL.createTable(TABLE, FAMILIES);
|
||||||
|
assertSame(conf, table.getConfiguration());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test from client side of an involved filter against a multi family that
|
* Test from client side of an involved filter against a multi family that
|
||||||
* involves deletes.
|
* involves deletes.
|
||||||
|
|
Loading…
Reference in New Issue