public EventTable getIndexByDesc(IndexMultiKey indexKey) { EventTableIndexRepositoryEntry entry = tableIndexesRefCount.get(indexKey); if (entry == null) { return null; } return entry.getTable(); }
public void removeIndex(IndexMultiKey index) { EventTableIndexRepositoryEntry entry = tableIndexesRefCount.remove(index); if (entry != null) { tables.remove(entry.getTable()); if (entry.getOptionalIndexName() != null) { explicitIndexes.remove(entry.getOptionalIndexName()); } } }
public Pair<IndexMultiKey, EventTableAndNamePair> addExplicitIndexOrReuse( boolean unique, List<IndexedPropDesc> hashProps, List<IndexedPropDesc> btreeProps, Iterable<EventBean> prefilledEvents, EventType indexedType, String indexName) { if (hashProps.isEmpty() && btreeProps.isEmpty()) { throw new IllegalArgumentException("Invalid zero element list for hash and btree columns"); } // Get an existing table, if any, matching the exact requirement IndexMultiKey indexPropKeyMatch = EventTableIndexUtil.findExactMatchNameAndType( tableIndexesRefCount.keySet(), unique, hashProps, btreeProps); if (indexPropKeyMatch != null) { EventTableIndexRepositoryEntry refTablePair = tableIndexesRefCount.get(indexPropKeyMatch); return new Pair<IndexMultiKey, EventTableAndNamePair>( indexPropKeyMatch, new EventTableAndNamePair(refTablePair.getTable(), refTablePair.getOptionalIndexName())); } return addIndex(unique, hashProps, btreeProps, prefilledEvents, indexedType, indexName, false); }
public void addIndex(IndexMultiKey indexMultiKey, EventTableIndexRepositoryEntry entry) { tableIndexesRefCount.put(indexMultiKey, entry); tables.add(entry.getTable()); }