@Test public void testHBaseFsck() throws Exception { assertNoErrors(doFsck(false)); TEST_UTIL.createTable(TABLE, FAM); assertNoErrors(doFsck(false)); HTable meta = new HTable(conf, HTableDescriptor.META_TABLEDESC.getName()); ResultScanner scanner = meta.getScanner(new Scan()); resforloop: for (Result res : scanner) { long startCode = Bytes.toLong(res.getValue(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER)); for (JVMClusterUtil.RegionServerThread rs : TEST_UTIL.getHBaseCluster().getRegionServerThreads()) { HServerInfo hsi = rs.getRegionServer().getServerInfo(); if (startCode != hsi.getStartCode()) { Put put = new Put(res.getRow()); put.add(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER, Bytes.toBytes(hsi.getHostnamePort())); put.add(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER, Bytes.toBytes(hsi.getStartCode())); meta.put(put); break resforloop; } } } assertErrors(doFsck(true), new ERROR_CODE[]{ ERROR_CODE.SERVER_DOES_NOT_MATCH_META}); Thread.sleep(15000); assertNoErrors(doFsck(false)); new HTable(conf, TABLE).getScanner(new Scan()); }
public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException { this.conf = conf; HBaseAdmin admin = new HBaseAdmin(conf); status = admin.getMaster().getClusterStatus(); connection = admin.getConnection(); numThreads = conf.getInt("hbasefsck.numthreads", numThreads); executor = new ThreadPoolExecutor(0, numThreads, THREADS_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); }
HBaseFsck { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException { this.conf = conf; HBaseAdmin admin = new HBaseAdmin(conf); status = admin.getMaster().getClusterStatus(); connection = admin.getConnection(); numThreads = conf.getInt("hbasefsck.numthreads", numThreads); executor = new ThreadPoolExecutor(0, numThreads, THREADS_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); } }
HBaseFsck { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException { this.conf = conf; HBaseAdmin admin = new HBaseAdmin(conf); status = admin.getMaster().getClusterStatus(); connection = admin.getConnection(); numThreads = conf.getInt("hbasefsck.numthreads", numThreads); executor = new ThreadPoolExecutor(0, numThreads, THREADS_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); } HBaseFsck(Configuration conf); }
HBaseFsck { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException { this.conf = conf; HBaseAdmin admin = new HBaseAdmin(conf); status = admin.getMaster().getClusterStatus(); connection = admin.getConnection(); numThreads = conf.getInt("hbasefsck.numthreads", numThreads); executor = new ThreadPoolExecutor(0, numThreads, THREADS_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); } HBaseFsck(Configuration conf); ErrorReporter getErrors(); static void main(String [] args); }
HBaseFsck { public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException { this.conf = conf; HBaseAdmin admin = new HBaseAdmin(conf); status = admin.getMaster().getClusterStatus(); connection = admin.getConnection(); numThreads = conf.getInt("hbasefsck.numthreads", numThreads); executor = new ThreadPoolExecutor(0, numThreads, THREADS_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); } HBaseFsck(Configuration conf); ErrorReporter getErrors(); static void main(String [] args); static final long DEFAULT_TIME_LAG; static final long DEFAULT_SLEEP_BEFORE_RERUN; }