本文整理了Java中org.apache.hadoop.hbase.regionserver.HStore.getStoreEngine()
方法的一些代码示例,展示了HStore.getStoreEngine()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HStore.getStoreEngine()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.HStore
类名称:HStore
方法名:getStoreEngine
[英]Returns the StoreEngine that is backing this concrete implementation of Store.
[中]返回支持此具体存储实现的StoreEngine。
代码示例来源:origin: apache/hbase
private void clearCompactedfiles(List<HStoreFile> filesToRemove) throws IOException {
LOG.trace("Clearing the compacted file {} from this store", filesToRemove);
try {
lock.writeLock().lock();
this.getStoreEngine().getStoreFileManager().removeCompactedFiles(filesToRemove);
} finally {
lock.writeLock().unlock();
}
}
代码示例来源:origin: apache/hbase
@VisibleForTesting
public synchronized void closeAndArchiveCompactedFiles(boolean storeClosing) throws IOException {
// ensure other threads do not attempt to archive the same files on close()
archiveLock.lock();
try {
lock.readLock().lock();
Collection<HStoreFile> copyCompactedfiles = null;
try {
Collection<HStoreFile> compactedfiles =
this.getStoreEngine().getStoreFileManager().getCompactedfiles();
if (CollectionUtils.isNotEmpty(compactedfiles)) {
// Do a copy under read lock
copyCompactedfiles = new ArrayList<>(compactedfiles);
} else {
LOG.trace("No compacted files to archive");
}
} finally {
lock.readLock().unlock();
}
if (CollectionUtils.isNotEmpty(copyCompactedfiles)) {
removeCompactedfiles(copyCompactedfiles, storeClosing);
}
} finally {
archiveLock.unlock();
}
}
代码示例来源:origin: apache/hbase
private void closeCompactedFile(int index) throws IOException {
Collection<HStoreFile> files =
this.store.getStoreEngine().getStoreFileManager().getCompactedfiles();
HStoreFile sf = null;
Iterator<HStoreFile> it = files.iterator();
for (int i = 0; i <= index; i++) {
sf = it.next();
}
sf.closeStoreFile(true);
store.getStoreEngine().getStoreFileManager().removeCompactedFiles(Lists.newArrayList(sf));
}
代码示例来源:origin: apache/hbase
@Override
public boolean evaluate() throws Exception {
for (HRegion region : cluster.getRegions(tn)) {
for (HStore store : region.getStores()) {
Collection<HStoreFile> files =
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
if (null != files && !files.isEmpty()) {
LOG.debug(region.getRegionInfo().getEncodedName() + " still has compacted files");
return false;
}
}
}
return true;
}
}
代码示例来源:origin: apache/hbase
private static List<Path> findCompactedStorefilePaths(TableName tableName) throws Exception {
List<Path> paths = new ArrayList<>();
for (Region region : TEST_UTIL.getRSForFirstRegionInTable(tableName)
.getRegions(tableName)) {
for (HStore store : ((HRegion) region).getStores()) {
Collection<HStoreFile> compactedfiles =
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
if (compactedfiles != null) {
for (HStoreFile storefile : compactedfiles) {
paths.add(storefile.getPath());
}
}
}
}
return paths;
}
代码示例来源:origin: apache/hbase
StoreFileManager fileManager = store.getStoreEngine().getStoreFileManager();
Collection<HStoreFile> initialCompactedFiles = fileManager.getCompactedfiles();
assertTrue(initialCompactedFiles == null || initialCompactedFiles.isEmpty());
代码示例来源:origin: apache/hbase
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio() + 0.1;
conf.setFloat(strPrefix + "ratio", (float)newCompactionRatio);
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio(),
0.00001);
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak() + 0.1;
conf.setFloat(strPrefix + "ratio.offpeak",
(float)newOffPeakCompactionRatio);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newOffPeakCompactionRatio,
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak(),
0.00001);
hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint() + 10;
conf.setLong("hbase.regionserver.thread.compaction.throttle",
newThrottlePoint);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newThrottlePoint,
hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint());
hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact() + 1;
conf.setLong(strPrefix + "min", newMinFilesToCompact);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newMinFilesToCompact,
hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact());
hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact() + 1;
conf.setLong(strPrefix + "max", newMaxFilesToCompact);
代码示例来源:origin: apache/hbase
assertEquals(1, region.getStoreFileList(new byte[][]{familyNameBytes}).size());
assertEquals(refSFCount+1,
((HStore)region.getStore(familyNameBytes)).getStoreEngine().getStoreFileManager()
.getCompactedfiles().size());
assertEquals(1, region.getStoreFileList(new byte[][]{familyNameBytes}).size());
assertEquals(0,
((HStore)region.getStore(familyNameBytes)).getStoreEngine().getStoreFileManager()
.getCompactedfiles().size());
代码示例来源:origin: apache/hbase
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
compactedfiles = store.getStoreEngine().getStoreFileManager().getCompactedfiles();
for(HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 3", 3, ((HStoreFile) file).getRefCount());
((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles().size());
while (scanCompletedCounter.get() != 3) {
Thread.sleep(100);
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
for (HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 0", 0, file.getRefCount());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
代码示例来源:origin: apache/hbase
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles().size());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
代码示例来源:origin: apache/hbase
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
for(HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 3", 0, ((HStoreFile) file).getRefCount());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
代码示例来源:origin: org.apache.hbase/hbase-server
private void closeCompactedFile(int index) throws IOException {
Collection<HStoreFile> files =
this.store.getStoreEngine().getStoreFileManager().getCompactedfiles();
HStoreFile sf = null;
Iterator<HStoreFile> it = files.iterator();
for (int i = 0; i <= index; i++) {
sf = it.next();
}
sf.closeStoreFile(true);
store.getStoreEngine().getStoreFileManager().removeCompactedFiles(Lists.newArrayList(sf));
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Override
public boolean evaluate() throws Exception {
for (HRegion region : cluster.getRegions(tn)) {
for (HStore store : region.getStores()) {
Collection<HStoreFile> files =
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
if (null != files && !files.isEmpty()) {
LOG.debug(region.getRegionInfo().getEncodedName() + " still has compacted files");
return false;
}
}
}
return true;
}
}
代码示例来源:origin: org.apache.hbase/hbase-server
private static List<Path> findCompactedStorefilePaths(TableName tableName) throws Exception {
List<Path> paths = new ArrayList<>();
for (Region region : TEST_UTIL.getRSForFirstRegionInTable(tableName)
.getRegions(tableName)) {
for (HStore store : ((HRegion) region).getStores()) {
Collection<HStoreFile> compactedfiles =
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
if (compactedfiles != null) {
for (HStoreFile storefile : compactedfiles) {
paths.add(storefile.getPath());
}
}
}
}
return paths;
}
代码示例来源:origin: org.apache.hbase/hbase-server
StoreFileManager fileManager = store.getStoreEngine().getStoreFileManager();
Collection<HStoreFile> initialCompactedFiles = fileManager.getCompactedfiles();
assertTrue(initialCompactedFiles == null || initialCompactedFiles.isEmpty());
代码示例来源:origin: org.apache.hbase/hbase-server
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio() + 0.1;
conf.setFloat(strPrefix + "ratio", (float)newCompactionRatio);
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio(),
0.00001);
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak() + 0.1;
conf.setFloat(strPrefix + "ratio.offpeak",
(float)newOffPeakCompactionRatio);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newOffPeakCompactionRatio,
hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak(),
0.00001);
hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint() + 10;
conf.setLong("hbase.regionserver.thread.compaction.throttle",
newThrottlePoint);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newThrottlePoint,
hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint());
hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact() + 1;
conf.setLong(strPrefix + "min", newMinFilesToCompact);
rs1.getConfigurationManager().notifyAllObservers(conf);
assertEquals(newMinFilesToCompact,
hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact());
hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact() + 1;
conf.setLong(strPrefix + "max", newMaxFilesToCompact);
代码示例来源:origin: org.apache.hbase/hbase-server
assertEquals(1, region.getStoreFileList(new byte[][]{familyNameBytes}).size());
assertEquals(refSFCount+1,
((HStore)region.getStore(familyNameBytes)).getStoreEngine().getStoreFileManager()
.getCompactedfiles().size());
assertEquals(1, region.getStoreFileList(new byte[][]{familyNameBytes}).size());
assertEquals(0,
((HStore)region.getStore(familyNameBytes)).getStoreEngine().getStoreFileManager()
.getCompactedfiles().size());
代码示例来源:origin: org.apache.hbase/hbase-server
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
compactedfiles = store.getStoreEngine().getStoreFileManager().getCompactedfiles();
for(HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 3", 3, ((HStoreFile) file).getRefCount());
((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles().size());
while (scanCompletedCounter.get() != 3) {
Thread.sleep(100);
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
for (HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 0", 0, file.getRefCount());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
代码示例来源:origin: org.apache.hbase/hbase-server
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles().size());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
代码示例来源:origin: org.apache.hbase/hbase-server
store.getStoreEngine().getStoreFileManager().getCompactedfiles();
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
for(HStoreFile file : compactedfiles) {
assertEquals("Refcount should be 3", 0, ((HStoreFile) file).getRefCount());
compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
assertTrue(compactedfiles.isEmpty());
内容来源于网络,如有侵权,请联系作者删除!