Esempio n. 1
0
  void make_tuple(Tuple tuple, IndexDesc record) throws IOException, IndexCatalogException {
    try {
      tuple.setStrFld(1, record.relName);
      tuple.setStrFld(2, record.attrName);

      if (record.accessType.indexType == IndexType.None) tuple.setIntFld(3, 0);
      else if (record.accessType.indexType == IndexType.B_Index) tuple.setIntFld(3, 1);
      else if (record.accessType.indexType == IndexType.Hash) tuple.setIntFld(3, 2);
      else System.out.println("Invalid accessType in IndexCatalog::make_tupl");

      if (record.order.tupleOrder == TupleOrder.Ascending) tuple.setIntFld(4, 0);
      else if (record.order.tupleOrder == TupleOrder.Descending) tuple.setIntFld(4, 1);
      else if (record.order.tupleOrder == TupleOrder.Random) tuple.setIntFld(4, 2);
      else System.out.println("Invalid order in IndexCatalog::make_tuple");

      tuple.setIntFld(5, record.clustered);
      tuple.setIntFld(6, record.distinctKeys);
      tuple.setIntFld(7, record.indexPages);
    } catch (Exception e) {
      throw new IndexCatalogException(e, "make_tuple failed");
    }

    return;
  };