/**
  * @param workingPage
  * @throws IOException renews page,freeOffset and numOfKeys
  */
 private void changeWorkingPageTo(XBufferChannel hlpr) throws IOException {
   xBufferChannel = hlpr; // may change
   freeOffset = Settings.dataStartPos; // init
   numOfKeys = 0; // init this is zero in this point
   logicFileMgr.creatSibling(hlpr);
   //        xBufferChannel.position(Settings.freeOffsetPos);//5
   //        xBufferChannel.putInt(freeOffset);
   //        xBufferChannel.position(Settings.numOfKeysPos);
   //        xBufferChannel.putInt(numOfKeys);
   unTakenNodes = numOfKeys; // ???what is this for?
 }
Пример #2
0
  public Document importDB(String DbName, String xmlText)
      throws IOException, ParserConfigurationException, TransformerConfigurationException,
          DBException // import(ame,file)
      {

    XmlParser parser = XmlParser.Instance;
    Document doc;
    LogicalFileManager logFileMgr = LogicalFileManager.Instance;
    logFileMgr.createPhysicalFile(DbName);
    // creates indexes on physical layer:
    doc = docMgr.createDoc(DbName);
    //        try
    //        {
    // parses doc and insers elements into indexes:
    parser.parseXmlString(xmlText, doc);
    //        }
    //        catch(Exception e)
    //        {
    //            System.out.println(e.getMessage());
    //        }//bayad doc ro bhehs pas bdam ta tusho por kone.
    // khorujie parser void ast,engar k faghat method haye handler ra(start,end,...)ruye
    // file ya input stream ejra mikonad
    return doc;
  }
 private int createSSIndexPage() throws IOException {
   // we use pages as in BTreeType just we use 2bytes more(for isRoot n isLeaf are invalid here)
   return logicFileMgr.creatRootPage(
       indexName, (byte) Settings.invalidValue, (byte) Settings.invalidValue, 0, xBufferChannel);
   // logicFileMgr.addPage(indexName,(byte)Settings.invalidValue,(byte)Settings.invalidValue,numOfKeys);
 }