Beispiel #1
0
  public void validateIsIndex() {
    long blockIndex = BlockStore.blockIdToIndex(getBlockId());

    int allocCode = getStore().getAllocation(blockIndex);

    if (allocCode != BlockStore.ALLOC_INDEX) {
      RuntimeException exn;
      exn = new IllegalStateException(L.l("block {0} is not an index code={1}", this, allocCode));
      exn.fillInStackTrace();

      throw exn;
      /*
      if (_isValidation) {
        log.warning(exn.toString()));
      }
      else {
        log.log(Level.WARNING, exn.toString(), exn);

        ShutdownSystem.shutdownActive(ExitCode.HEALTH,
                                      L.l("Internal database issue: forcing restart {0}",
                                          exn.toString()));
      }
      */
    }
  }
Beispiel #2
0
  public boolean isIndex() {
    long blockIndex = BlockStore.blockIdToIndex(getBlockId());

    return getStore().getAllocation(blockIndex) == BlockStore.ALLOC_INDEX;
  }