gpt4 book ai didi

org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 04:05:05 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease()方法的一些代码示例,展示了WALProcedureStore.recoverLease()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WALProcedureStore.recoverLease()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore
类名称:WALProcedureStore
方法名:recoverLease

WALProcedureStore.recoverLease介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

public void setUpProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("\n\nLogs directory : " + logDir.toString() + "\n\n");
 fs.delete(logDir, true);
 store = ProcedureTestingUtility.createWalStore(conf, logDir);
 store.start(1);
 store.recoverLease();
 store.load(new LoadCounter());
}

代码示例来源:origin: apache/hbase

private void storeRestart(ProcedureStore.ProcedureLoader loader) throws IOException {
 System.out.println("Restarting procedure store to read back the WALs");
 store.stop(false);
 store.start(1);
 store.recoverLease();
 long startTime = currentTimeMillis();
 store.load(loader);
 long timeTaken = System.currentTimeMillis() - startTime;
 System.out.println("******************************************");
 System.out.println("Load time : " + (timeTaken / 1000.0f) + "sec");
 System.out.println("******************************************");
 System.out.println("Raw format for scripts");
   System.out.println(String.format("RESULT [%s=%s, %s=%s, %s=%s, %s=%s, %s=%s, "
       + "total_time_ms=%s]",
   NUM_PROCS_OPTION.getOpt(), numProcs, STATE_SIZE_OPTION.getOpt(), serializedState.length,
   UPDATES_PER_PROC_OPTION.getOpt(), updatesPerProc, DELETE_PROCS_FRACTION_OPTION.getOpt(),
   deleteProcsFraction, NUM_WALS_OPTION.getOpt(), numWals, timeTaken));
}

代码示例来源:origin: apache/hbase

private void setupProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("Logs directory : " + logDir.toString());
 fs.delete(logDir, true);
 if ("nosync".equals(syncType)) {
  store = new NoSyncWalProcedureStore(conf, logDir);
 } else {
  store = ProcedureTestingUtility.createWalStore(conf, logDir);
 }
 store.start(numThreads);
 store.recoverLease();
 store.load(new ProcedureTestingUtility.LoadCounter());
 System.out.println("Starting new log : "
   + store.getActiveLogs().get(store.getActiveLogs().size() - 1));
}

代码示例来源:origin: apache/hbase

private void setupDFS() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 MiniDFSCluster dfs = UTIL.startMiniDFSCluster(3);
 CommonFSUtils.setWALRootDir(conf, new Path(conf.get("fs.defaultFS"), "/tmp/wal"));
 Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
 store = ProcedureTestingUtility.createWalStore(conf, logDir);
 store.registerListener(stopProcedureListener);
 store.start(8);
 store.recoverLease();
}

代码示例来源:origin: apache/hbase

@Test
public void testLogFileAleadExists() throws IOException {
 final boolean[] tested = {false};
 WALProcedureStore mStore = Mockito.spy(procStore);
 Answer<Boolean> ans = new Answer<Boolean>() {
  @Override
  public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable {
   long logId = ((Long) invocationOnMock.getArgument(0)).longValue();
   switch ((int) logId) {
    case 2:
     // Create a file so that real rollWriter() runs into file exists condition
     Path logFilePath = mStore.getLogFilePath(logId);
     mStore.getFileSystem().create(logFilePath);
     break;
    case 3:
     // Success only when we retry with logId 3
     tested[0] = true;
    default:
     break;
   }
   return (Boolean) invocationOnMock.callRealMethod();
  }
 };
 // First time Store has one log file, next id will be 2
 Mockito.doAnswer(ans).when(mStore).rollWriter(2);
 // next time its 3
 Mockito.doAnswer(ans).when(mStore).rollWriter(3);
 mStore.recoverLease();
 assertTrue(tested[0]);
}

代码示例来源:origin: apache/hbase

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 setupConfig(htu.getConfiguration());
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 procStore.load(new LoadCounter());
}

代码示例来源:origin: apache/hbase

procStore2.recoverLease();

代码示例来源:origin: apache/hbase

backupStore3.recoverLease();

代码示例来源:origin: apache/hbase

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 setupConfiguration(htu.getConfiguration());
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 LoadCounter loader = new LoadCounter();
 procStore.load(loader);
 assertEquals(0, loader.getMaxProcId());
 assertEquals(0, loader.getLoadedCount());
 assertEquals(0, loader.getCorruptedCount());
}

代码示例来源:origin: apache/hbase

procStore.recoverLease();
procStore.load(loader);
assertEquals(procs.length, loader.getMaxProcId());

代码示例来源:origin: org.apache.hbase/hbase-procedure

public void setUpProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("\n\nLogs directory : " + logDir.toString() + "\n\n");
 fs.delete(logDir, true);
 store = ProcedureTestingUtility.createWalStore(conf, logDir);
 store.start(1);
 store.recoverLease();
 store.load(new LoadCounter());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-procedure

public void setUpProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("\n\nLogs directory : " + logDir.toString() + "\n\n");
 fs.delete(logDir, true);
 store = ProcedureTestingUtility.createWalStore(conf, logDir);
 store.start(1);
 store.recoverLease();
 store.load(new LoadCounter());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-procedure

private void setupProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("Logs directory : " + logDir.toString());
 fs.delete(logDir, true);
 if ("nosync".equals(syncType)) {
  store = new NoSyncWalProcedureStore(conf, logDir);
 } else {
  store = ProcedureTestingUtility.createWalStore(conf, logDir);
 }
 store.start(numThreads);
 store.recoverLease();
 store.load(new ProcedureTestingUtility.LoadCounter());
 System.out.println("Starting new log : "
   + store.getActiveLogs().get(store.getActiveLogs().size() - 1));
}

代码示例来源:origin: com.aliyun.hbase/alihbase-procedure

private void storeRestart(ProcedureStore.ProcedureLoader loader) throws IOException {
 System.out.println("Restarting procedure store to read back the WALs");
 store.stop(false);
 store.start(1);
 store.recoverLease();
 long startTime = currentTimeMillis();
 store.load(loader);
 long timeTaken = System.currentTimeMillis() - startTime;
 System.out.println("******************************************");
 System.out.println("Load time : " + (timeTaken / 1000.0f) + "sec");
 System.out.println("******************************************");
 System.out.println("Raw format for scripts");
   System.out.println(String.format("RESULT [%s=%s, %s=%s, %s=%s, %s=%s, %s=%s, "
       + "total_time_ms=%s]",
   NUM_PROCS_OPTION.getOpt(), numProcs, STATE_SIZE_OPTION.getOpt(), serializedState.length,
   UPDATES_PER_PROC_OPTION.getOpt(), updatesPerProc, DELETE_PROCS_FRACTION_OPTION.getOpt(),
   deleteProcsFraction, NUM_WALS_OPTION.getOpt(), numWals, timeTaken));
}

代码示例来源:origin: org.apache.hbase/hbase-procedure

private void setupProcedureStore() throws IOException {
 Path testDir = UTIL.getDataTestDir();
 FileSystem fs = testDir.getFileSystem(conf);
 Path logDir = new Path(testDir, "proc-logs");
 System.out.println("Logs directory : " + logDir.toString());
 fs.delete(logDir, true);
 if ("nosync".equals(syncType)) {
  store = new NoSyncWalProcedureStore(conf, logDir);
 } else {
  store = ProcedureTestingUtility.createWalStore(conf, logDir);
 }
 store.start(numThreads);
 store.recoverLease();
 store.load(new ProcedureTestingUtility.LoadCounter());
 System.out.println("Starting new log : "
   + store.getActiveLogs().get(store.getActiveLogs().size() - 1));
}

代码示例来源:origin: org.apache.hbase/hbase-server

private void setupDFS() throws Exception {
 MiniDFSCluster dfs = UTIL.startMiniDFSCluster(3);
 Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
 store = ProcedureTestingUtility.createWalStore(UTIL.getConfiguration(), logDir);
 store.registerListener(stopProcedureListener);
 store.start(8);
 store.recoverLease();
}

代码示例来源:origin: org.apache.hbase/hbase-procedure

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 setupConfig(htu.getConfiguration());
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 procStore.load(new LoadCounter());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-procedure

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 setupConfig(htu.getConfiguration());
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 procStore.load(new LoadCounter());
}

代码示例来源:origin: org.apache.hbase/hbase-procedure

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 setupConfiguration(htu.getConfiguration());
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 LoadCounter loader = new LoadCounter();
 procStore.load(loader);
 assertEquals(0, loader.getMaxProcId());
 assertEquals(0, loader.getLoadedCount());
 assertEquals(0, loader.getCorruptedCount());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-procedure

@Before
public void setUp() throws IOException {
 htu = new HBaseCommonTestingUtility();
 setupConfiguration(htu.getConfiguration());
 testDir = htu.getDataTestDir();
 fs = testDir.getFileSystem(htu.getConfiguration());
 assertTrue(testDir.depth() > 1);
 logDir = new Path(testDir, "proc-logs");
 procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
 procStore.start(PROCEDURE_STORE_SLOTS);
 procStore.recoverLease();
 LoadCounter loader = new LoadCounter();
 procStore.load(loader);
 assertEquals(0, loader.getMaxProcId());
 assertEquals(0, loader.getLoadedCount());
 assertEquals(0, loader.getCorruptedCount());
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com