Search in sources :

Example 1 with AbstractLSMIndex

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

the class RecoveryManager method getLocalMinFirstLSN.

@Override
public long getLocalMinFirstLSN() throws HyracksDataException {
    IDatasetLifecycleManager datasetLifecycleManager = txnSubsystem.getAsterixAppRuntimeContextProvider().getDatasetLifecycleManager();
    List<IIndex> openIndexList = datasetLifecycleManager.getOpenResources();
    long firstLSN;
    //the min first lsn can only be the current append or smaller
    long minFirstLSN = logMgr.getAppendLSN();
    if (!openIndexList.isEmpty()) {
        for (IIndex index : openIndexList) {
            AbstractLSMIOOperationCallback ioCallback = (AbstractLSMIOOperationCallback) ((ILSMIndex) index).getIOOperationCallback();
            if (!((AbstractLSMIndex) index).isCurrentMutableComponentEmpty() || ioCallback.hasPendingFlush()) {
                firstLSN = ioCallback.getFirstLSN();
                minFirstLSN = Math.min(minFirstLSN, firstLSN);
            }
        }
    }
    return minFirstLSN;
}
Also used : IDatasetLifecycleManager(org.apache.asterix.common.api.IDatasetLifecycleManager) IIndex(org.apache.hyracks.storage.common.IIndex) AbstractLSMIOOperationCallback(org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback) AbstractLSMIndex(org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex)

Aggregations

IDatasetLifecycleManager (org.apache.asterix.common.api.IDatasetLifecycleManager)1 AbstractLSMIOOperationCallback (org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback)1 AbstractLSMIndex (org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex)1 IIndex (org.apache.hyracks.storage.common.IIndex)1