public ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Column Store size can't exceed 65534"); } this.graphStore = graphStore; this.configuration = graphStore != null ? graphStore.configuration : new Configuration(); this.lock = GraphStoreConfiguration.ENABLE_AUTO_LOCKING ? new TableLock() : null; this.garbageQueue = new ShortRBTreeSet(); this.idMap = new Object2ShortOpenHashMap<String>(MAX_SIZE); this.columns = new ColumnImpl[MAX_SIZE]; this.elementType = elementType; this.indexStore = indexed ? new IndexStore<T>(this) : null; idMap.defaultReturnValue(NULL_SHORT); this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<TableObserverImpl>() : null; }
public ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Column Store size can't exceed 65534"); } this.graphStore = graphStore; this.configuration = graphStore != null ? graphStore.configuration : new Configuration(); this.lock = GraphStoreConfiguration.ENABLE_AUTO_LOCKING ? new TableLock() : null; this.garbageQueue = new ShortRBTreeSet(); this.idMap = new Object2ShortOpenHashMap<String>(MAX_SIZE); this.columns = new ColumnImpl[MAX_SIZE]; this.elementType = elementType; this.indexStore = indexed ? new IndexStore<T>(this) : null; idMap.defaultReturnValue(NULL_SHORT); this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<TableObserverImpl>() : null; }
public EdgeTypeStore(Configuration config) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Edge Type Store size can't exceed 65534"); } this.configuration = config; this.garbageQueue = new ShortRBTreeSet(); this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE); this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE); labelMap.defaultReturnValue(NULL_SHORT); // Add null type short id = intToShort(NULL_LABEL); length++; labelMap.put(null, id); idMap.put(id, null); }
public EdgeTypeStore(Configuration config) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Edge Type Store size can't exceed 65534"); } this.configuration = config; this.garbageQueue = new ShortRBTreeSet(); this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE); this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE); labelMap.defaultReturnValue(NULL_SHORT); // Add null type short id = intToShort(NULL_LABEL); length++; labelMap.put(null, id); idMap.put(id, null); }
public AssociationRuleMining(ShortColumn sets, ShortColumn items, double support) { Table temp = Table.create("temp"); temp.addColumn(sets.copy()); temp.addColumn(items.copy()); temp.sortAscendingOn(sets.name(), items.name()); ViewGroup baskets = temp.splitOn(temp.column(0)); int[][] itemsets = new int[baskets.size()][]; int basketIndex = 0; for (TemporaryView basket : baskets) { ShortRBTreeSet set = new ShortRBTreeSet(basket.shortColumn(1).data()); int itemIndex = 0; itemsets[basketIndex] = new int[set.size()]; for (short item : set) { itemsets[basketIndex][itemIndex] = item; itemIndex++; } basketIndex++; } this.model = new ARM(itemsets, support); }
public FrequentItemset(ShortColumn sets, ShortColumn items, double support) { Table temp = Table.create("temp"); temp.addColumn(sets.copy()); temp.addColumn(items.copy()); temp.sortAscendingOn(sets.name(), items.name()); ViewGroup baskets = temp.splitOn(temp.column(0)); this.setCount = baskets.size(); int[][] itemsets = new int[setCount][]; int basketIndex = 0; for (TemporaryView basket : baskets) { ShortRBTreeSet set = new ShortRBTreeSet(basket.shortColumn(1).data()); int itemIndex = 0; itemsets[basketIndex] = new int[set.size()]; for (short item : set) { itemsets[basketIndex][itemIndex] = item; itemIndex++; } basketIndex++; } this.model = new FPGrowth(itemsets, support); }