HBASE-10471 Remove HTD.isAsyncLogFlush() from trunk
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1565003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eb55803634
commit
3cc587b961
|
@ -596,34 +596,6 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
|
||||||
setValue(COMPACTION_ENABLED_KEY, isEnable ? TRUE : FALSE);
|
setValue(COMPACTION_ENABLED_KEY, isEnable ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if async log edits are enabled on the table.
|
|
||||||
*
|
|
||||||
* @return true if that async log flush is enabled on the table
|
|
||||||
* @deprecated Since 0.96 we no longer have an explicity deferred log flush/sync functionality.
|
|
||||||
* Use {@link #getDurability()}.
|
|
||||||
*/
|
|
||||||
public synchronized boolean isAsyncLogFlush() {
|
|
||||||
return getDurability() == Durability.ASYNC_WAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is used to allowing the log edits syncing to the file system. Everytime
|
|
||||||
* an edit is sent to the server it is first sync'd to the file system by the
|
|
||||||
* log writer. This sync is an expensive operation and thus can be deferred so
|
|
||||||
* that the edits are kept in memory until the background async writer-sync-notifier
|
|
||||||
* threads do the sync and not explicitly flushed for every edit.
|
|
||||||
* <p>
|
|
||||||
* NOTE:- This option might result in data loss if the region server crashes
|
|
||||||
* before these pending edits in memory are flushed onto the filesystem.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param isAsyncLogFlush
|
|
||||||
*/
|
|
||||||
public synchronized void setAsyncLogFlush(final boolean isAsyncLogFlush) {
|
|
||||||
this.setDurability(isAsyncLogFlush ? Durability.ASYNC_WAL : DEFAULT_DURABLITY);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@link Durability} setting for the table. This defaults to Durability.USE_DEFAULT.
|
* Sets the {@link Durability} setting for the table. This defaults to Durability.USE_DEFAULT.
|
||||||
* @param durability enum value
|
* @param durability enum value
|
||||||
|
|
|
@ -79,8 +79,8 @@ public class TestDurability {
|
||||||
HLog wal = HLogFactory.createHLog(FS, DIR, "hlogdir",
|
HLog wal = HLogFactory.createHLog(FS, DIR, "hlogdir",
|
||||||
"hlogdir_archive", CONF);
|
"hlogdir_archive", CONF);
|
||||||
byte[] tableName = Bytes.toBytes("TestDurability");
|
byte[] tableName = Bytes.toBytes("TestDurability");
|
||||||
HRegion region = createHRegion(tableName, "region", wal, false);
|
HRegion region = createHRegion(tableName, "region", wal, Durability.USE_DEFAULT);
|
||||||
HRegion deferredRegion = createHRegion(tableName, "deferredRegion", wal, true);
|
HRegion deferredRegion = createHRegion(tableName, "deferredRegion", wal, Durability.ASYNC_WAL);
|
||||||
|
|
||||||
region.put(newPut(null));
|
region.put(newPut(null));
|
||||||
verifyHLogCount(wal, 1);
|
verifyHLogCount(wal, 1);
|
||||||
|
@ -142,7 +142,7 @@ public class TestDurability {
|
||||||
HLog wal = HLogFactory.createHLog(FS, DIR, "myhlogdir",
|
HLog wal = HLogFactory.createHLog(FS, DIR, "myhlogdir",
|
||||||
"myhlogdir_archive", CONF);
|
"myhlogdir_archive", CONF);
|
||||||
byte[] tableName = Bytes.toBytes("TestIncrement");
|
byte[] tableName = Bytes.toBytes("TestIncrement");
|
||||||
HRegion region = createHRegion(tableName, "increment", wal, false);
|
HRegion region = createHRegion(tableName, "increment", wal, Durability.USE_DEFAULT);
|
||||||
|
|
||||||
// col1: amount = 1, 1 write back to WAL
|
// col1: amount = 1, 1 write back to WAL
|
||||||
Increment inc1 = new Increment(row1);
|
Increment inc1 = new Increment(row1);
|
||||||
|
@ -208,10 +208,10 @@ public class TestDurability {
|
||||||
|
|
||||||
// lifted from TestAtomicOperation
|
// lifted from TestAtomicOperation
|
||||||
private HRegion createHRegion (byte [] tableName, String callingMethod,
|
private HRegion createHRegion (byte [] tableName, String callingMethod,
|
||||||
HLog log, boolean isAsyncLogFlush)
|
HLog log, Durability durability)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
|
HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
|
||||||
htd.setAsyncLogFlush(isAsyncLogFlush);
|
htd.setDurability(durability);
|
||||||
HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
|
HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
|
||||||
htd.addFamily(hcd);
|
htd.addFamily(hcd);
|
||||||
HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
|
HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
|
||||||
|
|
Loading…
Reference in New Issue