Java 类org.apache.hadoop.hbase.MultithreadedTestUtil.RepeatingTestThread 实例源码

项目:LCIndex-HBase-0.94.16    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:LCIndex-HBase-0.94.16    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:IRIndex    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:IRIndex    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:HBase-Research    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:HBase-Research    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hbase-0.94.8-qod    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hbase-0.94.8-qod    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hbase-0.94.8-qod    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hbase-0.94.8-qod    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hindex    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling isTableDisabled doesn't NPE
 */
@Test
public void testTableDisabledRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread disabledChecker = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.isTableDisabled(Bytes.toBytes("tableToCheck"));
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(disabledChecker);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}
项目:hindex    文件:TestHConnection.java   
/**
 * Test that a connection that is aborted while calling getCurrentNrNRS doesn't NPE
 */
@Test
public void testGetCurrentNrHRSRace() throws Exception {
  final HConnection connection = new HConnectionRaceTester(TEST_UTIL.getConfiguration(), true);
  MultithreadedTestUtil.TestContext ctx =
    new MultithreadedTestUtil.TestContext(TEST_UTIL.getConfiguration());
  RepeatingTestThread getCurrentNrHRSCaller = new RepeatingTestThread(ctx) {
    @Override
    public void doAnAction() throws IOException {
      try {
        connection.getCurrentNrHRS();
      } catch (IOException ioe) {
        // Ignore.  ZK can legitimately fail, only care if we get a NullPointerException
      }
    }
  };
  AbortThread abortThread = new AbortThread(ctx, connection);

  ctx.addThread(getCurrentNrHRSCaller);
  ctx.addThread(abortThread);
  ctx.startThreads();
  ctx.waitFor(MILLIS_TO_WAIT_FOR_RACE);
  ctx.stop();
}