Search in sources :

Example 1 with DiskComponentMetadata

use of org.apache.hyracks.storage.am.lsm.common.impls.DiskComponentMetadata in project asterixdb by apache.

the class AbstractLSMIOOperationCallback method getComponentLSN.

public long getComponentLSN(List<? extends ILSMComponent> diskComponents) throws HyracksDataException {
    if (diskComponents == null) {
        // Flush operation of an LSM index are executed sequentially.
        synchronized (this) {
            long lsn = mutableLastLSNs[readIndex];
            return lsn;
        }
    }
    // Get max LSN from the diskComponents. Implies a merge IO operation or Recovery operation.
    long maxLSN = -1L;
    for (ILSMComponent c : diskComponents) {
        DiskComponentMetadata md = ((ILSMDiskComponent) c).getMetadata();
        maxLSN = Math.max(getTreeIndexLSN(md), maxLSN);
    }
    return maxLSN;
}
Also used : ILSMDiskComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponent) ILSMComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent) DiskComponentMetadata(org.apache.hyracks.storage.am.lsm.common.impls.DiskComponentMetadata)

Example 2 with DiskComponentMetadata

use of org.apache.hyracks.storage.am.lsm.common.impls.DiskComponentMetadata in project asterixdb by apache.

the class AbstractLSMIOOperationCallback method putComponentIdIntoMetadata.

private void putComponentIdIntoMetadata(ILSMDiskComponent component, List<ILSMComponent> oldComponents) throws HyracksDataException {
    DiskComponentMetadata metadata = component.getMetadata();
    ILSMDiskComponentId componentId = getComponentId(oldComponents);
    metadata.put(ILSMDiskComponentId.COMPONENT_ID_MIN_KEY, LongPointable.FACTORY.createPointable(componentId.getMinId()));
    metadata.put(ILSMDiskComponentId.COMPONENT_ID_MAX_KEY, LongPointable.FACTORY.createPointable(componentId.getMaxId()));
}
Also used : ILSMDiskComponentId(org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponentId) DiskComponentMetadata(org.apache.hyracks.storage.am.lsm.common.impls.DiskComponentMetadata)

Aggregations

DiskComponentMetadata (org.apache.hyracks.storage.am.lsm.common.impls.DiskComponentMetadata)2 ILSMComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent)1 ILSMDiskComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponent)1 ILSMDiskComponentId (org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponentId)1