/** * Creates a new instance. * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param indexFile * The file to use for storing the index. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, File indexFile) { this.ordering = ordering; this.indexFile = indexFile; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param indexFile * The file to use for storing the index. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, File indexFile) { this.ordering = ordering; this.indexFile = indexFile; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param tempFilePrefix * The prefix of the temporary file. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, String tempFilePrefix) { this.ordering = ordering; this.tempFilePrefix = tempFilePrefix; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param tempFilePrefix * The prefix of the temporary file. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, String tempFilePrefix) { this.ordering = ordering; this.tempFilePrefix = tempFilePrefix; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param tmpFilePrefix * The prefix of the storage file. */ public IndexedObjectStore(ObjectSerializationFactory serializationFactory, String tmpFilePrefix) { objectStore = new RandomAccessObjectStore<T>(serializationFactory, tmpFilePrefix + "d"); indexStore = new IndexStore<Long, LongLongIndexElement>( LongLongIndexElement.class, new ComparableComparator<Long>(), tmpFilePrefix + "i" ); }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param tmpFilePrefix * The prefix of the storage file. */ public IndexedObjectStore(ObjectSerializationFactory serializationFactory, String tmpFilePrefix) { objectStore = new RandomAccessObjectStore<T>(serializationFactory, tmpFilePrefix + "d"); indexStore = new IndexStore<Long, LongLongIndexElement>( LongLongIndexElement.class, new ComparableComparator<Long>(), tmpFilePrefix + "i" ); }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param objectStorageFile * The storage file to use for objects. * @param indexStorageFile * The storage file to use for the index. */ public IndexedObjectStore( ObjectSerializationFactory serializationFactory, File objectStorageFile, File indexStorageFile) { objectStore = new RandomAccessObjectStore<T>(serializationFactory, objectStorageFile); indexStore = new IndexStore<Long, LongLongIndexElement>( LongLongIndexElement.class, new ComparableComparator<Long>(), indexStorageFile ); }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param objectStorageFile * The storage file to use for objects. * @param indexStorageFile * The storage file to use for the index. */ public IndexedObjectStore( ObjectSerializationFactory serializationFactory, File objectStorageFile, File indexStorageFile) { objectStore = new RandomAccessObjectStore<T>(serializationFactory, objectStorageFile); indexStore = new IndexStore<Long, LongLongIndexElement>( LongLongIndexElement.class, new ComparableComparator<Long>(), indexStorageFile ); }
indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); } else { indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix);
indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); } else { indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix);