public void put(MemoryComponentMetadata metadata) throws HyracksDataException { metadata.copy(mdpManager); }
@Override public void after(long lsn) { pointable.setLong(lsn); try { index.getCurrentMemoryComponent().getMetadata().put(ComponentUtils.MARKER_LSN_KEY, pointable); } catch (HyracksDataException e) { throw new IllegalStateException(e); } }
public AbstractLSMMemoryComponent(AbstractLSMIndex lsmIndex, IVirtualBufferCache vbc, ILSMComponentFilter filter) { super(lsmIndex, filter); this.vbc = vbc; writerCount = 0; state = ComponentState.INACTIVE; isModified = new AtomicBoolean(); metadata = new MemoryComponentMetadata(); }
/** * Note: for memory metadata, it is expected that the key will be constant * * @throws HyracksDataException */ @Override public void put(IValueReference key, IValueReference value) throws HyracksDataException { lock.writeLock().lock(); try { ArrayBackedValueStorage stored = get(key); if (stored == null) { stored = new ArrayBackedValueStorage(); store.add(Pair.of(key, stored)); } stored.assign(value); } finally { lock.writeLock().unlock(); } }
@Override public final void reset() throws HyracksDataException { state = ComponentState.INACTIVE; isModified.set(false); metadata.reset(); if (filter != null) { filter.reset(); } doReset(); lsmIndex.memoryComponentsReset(); // a flush can be pending on a component that just completed its flush... here is when this can happen: // primary index has 2 components, secondary index has 2 components. // 2 flushes are scheduled on each p1, p2, s1, and s2. // p1 and p2 both finish. primary component 1 gets full and secondary doesn't have any entries (optional field). // then flush is scheduled on p1, s1 will have a pending flush in that case. if (pendingFlushes > 0) { schedule(LSMIOOperationType.FLUSH); pendingFlushes--; } }
/** * Note: for memory metadata, it is expected that the key will be constant * * @throws HyracksDataException */ @Override public void get(IValueReference key, ArrayBackedValueStorage value) throws HyracksDataException { lock.readLock().lock(); try { value.reset(); ArrayBackedValueStorage stored = get(key); if (stored != null) { value.append(stored); } } finally { lock.readLock().unlock(); } }
flushingComponent.getMetadata().copy(component.getMetadata()); abort = false; componentBulkLoader.end();
/** * Put LSM metadata state into the index's current memory component. * * @param index, * the LSM index. * @param key, * the key for the metadata state. * @param pointable, * the value for the metadata state. * @throws HyracksDataException */ public static void put(ILSMIndex index, IValueReference key, IPointable pointable) throws HyracksDataException { // write the opTracker to ensure the component layout don't change synchronized (index.getOperationTracker()) { index.getCurrentMemoryComponent().getMetadata().put(key, pointable); } }
c.getMetadata().get(key, value); if (value.getLength() != 0) {
flushingComponent.getMetadata().copy(component.getMetadata());
@Override public void forceUpdateMeta(ILSMIndexOperationContext ctx, IValueReference key, IValueReference value) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } getAndEnterComponents(ctx, LSMOperationType.FORCE_MODIFICATION, false); try { AbstractLSMMemoryComponent c = (AbstractLSMMemoryComponent) ctx.getComponentHolder().get(0); c.getMetadata().put(key, value); c.setModified(); } finally { exitAndComplete(ctx, LSMOperationType.FORCE_MODIFICATION); } }
ILSMMemoryComponent cmc = index.getCurrentMemoryComponent(); if (cmc.isReadable()) { index.getCurrentMemoryComponent().getMetadata().get(key, value);
filterManager.writeFilter(component.getLSMComponentFilter(), component.getMetadataHolder()); flushingComponent.getMetadata().copy(component.getMetadata()); componentBulkLoader.end(); return component;
@Override public void updateMeta(ILSMIndexOperationContext ctx, IValueReference key, IValueReference value) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } getAndEnterComponents(ctx, LSMOperationType.MODIFICATION, false); try { AbstractLSMMemoryComponent c = (AbstractLSMMemoryComponent) ctx.getComponentHolder().get(0); c.getMetadata().put(key, value); c.setModified(); } finally { exitAndComplete(ctx, LSMOperationType.MODIFICATION); } }
getFilterManager().writeFilter(component.getLSMComponentFilter(), component.getMetadataHolder()); flushingComponent.getMetadata().copy(component.getMetadata()); abort = false; componentBulkLoader.end();