Package isi.pasco2.parser

Examples of isi.pasco2.parser.HashBlock


      }
    }
  }

  public void unknownRecord(String type, int offset, byte[] record) {
    UnknownRecord u = new UnknownRecord(record, offset);
    if (initialized) {
      if (!newUrlRecords.contains(u)) {
        newUrlRecords.add(u);
      }
    } else {
View Full Code Here


          }
         
          IEIndexFileParser logparser = null;
          if (fileType == null) {
            System.err.println("Using cache file parser.");
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("cache")) {
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("history")) {
            logparser = new IEHistoryFileParser(fileName, fr, handler);
          } else {
            System.err.println("Unsupported file type.");
            HelpFormatter formatter = new HelpFormatter();
View Full Code Here

  public void testEmptyCacheFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\empty.cache.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IECacheFileParser(f, fr);
      parser.parseFile();

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

  public void testInitialCacheFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\first.cache.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IECacheFileParser(f, fr);

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

            System.err.println("Using cache file parser.");
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("cache")) {
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("history")) {
            logparser = new IEHistoryFileParser(fileName, fr, handler);
          } else {
            System.err.println("Unsupported file type.");
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp( "pasco2", options );
            System.exit(1);
View Full Code Here

  
   //DifferenceHandler cacheHandler = new DifferenceHandler("Cache");
   DifferenceHandler historyHandler = new DifferenceHandler("History");
  
   //IEIndexFileParser cacheparser = new IEIndexFileParser();
   IEHistoryFileParser historyParser ;
  
   while (true) {
      try {
        //IndexFile f1 = new FastReadIndexFile(cachePath);
        //cacheparser.parseFile(cachePath, f1, cacheHandler);
        //f1.close();
  
        IndexFile f2 = new FastReadIndexFile(historyPath);
        historyParser = new IEHistoryFileParser(cachePath, f2, historyHandler);
        historyParser.parseFile();
        f2.close();
       
        try {
          Thread.sleep(10000);
        } catch (InterruptedException ex) {
View Full Code Here

  public void testEmptyHistoryFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\empty.history.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IEHistoryFileParser(f, fr);
      parser.parseFile();

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

  public void testInitialHistoryFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\first.history.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IEHistoryFileParser(f, fr);

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

  public void testHistoryFile() {
    try {
      String f = "D:\\Documents and Settings\\bschatz\\Local Settings\\History\\History.IE5\\index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      CountingCacheHandler handler = new CountingCacheHandler();
      IEHistoryFileParser parser = new IEHistoryFileParser(f, fr);
     
      int allocatorBitMapOffset = 0x250;
      int bitMapIndex = 0;
      int storageStart = 0x4000;
      parser.primaryHashOffset = storageStart;
      int address = 0;
      while (address != storageStart) {
        fr.seek(allocatorBitMapOffset + bitMapIndex*4);

        int[] bitmap = {fr.readLittleEndianInt()};
        BitArray bits = new BitArray(32, bitmap);
        for (int i = 0 ; i < 32 ; i++ ){
          address = (bitMapIndex*32+i) * 0x80 + storageStart;
          fr.seek(address);
          int dword = fr.readLittleEndianInt();
 
          System.out.println((bitMapIndex*32+i) + " " + Integer.toHexString(dword) + " " + Integer.toHexString(address));
          assertTrue(bits.getBit(i) == parser.getAllocator().isRecordAllocated(address));

        }
        bitMapIndex += 1;
      }
    } catch (Exception e) {
View Full Code Here

  public void testCacheFile() {
    try {
      String f = "D:\\mysrc\\squidbro\\IFIP2006\\anon\\source\\minnow.willk.content.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      CountingCacheHandler handler = new CountingCacheHandler();
      IEHistoryFileParser parser = new IEHistoryFileParser(f, fr);
     
      int allocatorBitMapOffset = 0x250;
      int bitMapIndex = 0;
      int storageStart = 0x5000;
      parser.primaryHashOffset = storageStart;
      int address = 0;
      while (address != storageStart) {
        fr.seek(allocatorBitMapOffset + bitMapIndex*4);

        int[] bitmap = {fr.readLittleEndianInt()};
        BitArray bits = new BitArray(32, bitmap);
        for (int i = 0 ; i < 32 ; i++ ){
          address = (bitMapIndex*32+i) * 0x80 + storageStart;
          fr.seek(address);
          int dword = fr.readLittleEndianInt();
 
          System.out.println((bitMapIndex*32+i) + " " + Integer.toHexString(dword) + " " + Integer.toHexString(address));
          assertTrue(bits.getBit(i) == parser.getAllocator().isRecordAllocated(address));

        }
        bitMapIndex += 1;
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of isi.pasco2.parser.HashBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.