예제 #1
0
  @Test
  public void testReplicationFactor() throws Exception {
    clearIndex();

    HdfsUpdateLog ulog = (HdfsUpdateLog) h.getCore().getUpdateHandler().getUpdateLog();

    assertU(commit());
    addAndGetVersion(sdoc("id", "REP1"), null);
    assertU(commit());

    String[] logList = ulog.getLogList(new Path(ulog.getLogDir()));
    boolean foundRep2 = false;
    for (String tl : logList) {
      FileStatus status = fs.getFileStatus(new Path(ulog.getLogDir(), tl));
      if (status.getReplication() == 2) {
        foundRep2 = true;
        break;
      }
    }

    assertTrue("Expected to find tlogs with a replication factor of 2", foundRep2);
  }