@Override public boolean isMultiValueKey(IndexableItem indexableItem) throws JasDBStorageException { return wrappedKeyFactory.isMultiValueKey(indexableItem); }
@Override public boolean isMultiValueKey(IndexableItem indexableItem) throws JasDBStorageException { for(KeyFactory keyFactory : multiKeyloader.getKeyFactories()) { if(keyFactory.isMultiValueKey(indexableItem)) { return true; } } return false; }
public static void bulkInsertIndex(Index index, KeyInfo keyInfo, Iterator<IndexableItem> indexableItems) throws JasDBStorageException { KeyFactory keyFactory = keyInfo.getKeyFactory(); long counter = 0; int interval = 0; long start = System.currentTimeMillis(); while(indexableItems.hasNext()) { IndexableItem indexableItem = indexableItems.next(); if(keyFactory.isMultiValueKey(indexableItem)) { Set<Key> keys = keyFactory.createMultivalueKeys(indexableItem); for(Key key : keys) { index.insertIntoIndex(key); } } else { if(KeyUtil.isAnyDataPresent(indexableItem, index)) { Key key = keyFactory.createKey(indexableItem); index.insertIntoIndex(key); } } interval++; counter++; if(interval >= REPORT_INTERVAL) { LOG.info("Index: {} rebuild at: {} items", index, counter); interval = 0; } } long end = System.currentTimeMillis(); LOG.info("Finished rebuild for: {} items in: {}", counter, (end - start)); } }
public static Set<Key> createEntityKeys(Entity entity, Index index) throws JasDBStorageException { StatRecord createKey = StatisticsMonitor.createRecord("bag:createKey"); KeyFactory keyFactory = index.getKeyInfo().getKeyFactory(); Set<Key> insertKeys; if(keyFactory.isMultiValueKey(entity)) { insertKeys = keyFactory.createMultivalueKeys(entity); } else { insertKeys = new HashSet<>(); insertKeys.add(keyFactory.createKey(entity)); } createKey.stop(); return insertKeys; }
if(keyFactory.isMultiValueKey(indexableItem)) { Set<Key> keys = keyFactory.createMultivalueKeys(indexableItem); for(Key key : keys) {