Search in sources :

Example 1 with IIOManager

use of org.apache.hyracks.api.io.IIOManager in project asterixdb by apache.

the class RTreeResource method createInstance.

@Override
public IIndex createInstance(INCServiceContext ctx) throws HyracksDataException {
    IIOManager ioManager = ctx.getIoManager();
    FileReference resourceRef = ioManager.resolve(path);
    return RTreeUtils.createRTree(storageManager.getBufferCache(ctx), storageManager.getFileMapProvider(ctx), typeTraits, valueProviderFactories, comparatorFactories, rtreePolicyType, resourceRef, false, pageManagerFactory);
}
Also used : FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager)

Example 2 with IIOManager

use of org.apache.hyracks.api.io.IIOManager in project asterixdb by apache.

the class ExternalDatasetIndexesCommitOperatorDescriptor method performOpOnIndex.

@Override
protected void performOpOnIndex(IIndexDataflowHelper indexHelper, IHyracksTaskContext ctx) throws HyracksDataException {
    String path = indexHelper.getResource().getPath();
    IIOManager ioManager = ctx.getIoManager();
    FileReference file = ioManager.resolve(path);
    LOGGER.warn("performing the operation on " + file.getFile().getAbsolutePath());
    // Get index
    IIndex index = indexHelper.getIndexInstance();
    // commit transaction
    ((ITwoPCIndex) index).commitTransaction();
    LOGGER.warn("operation on " + file.getFile().getAbsolutePath() + " Succeded");
}
Also used : IIndex(org.apache.hyracks.storage.common.IIndex) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager) ITwoPCIndex(org.apache.hyracks.storage.am.lsm.common.api.ITwoPCIndex)

Example 3 with IIOManager

use of org.apache.hyracks.api.io.IIOManager in project asterixdb by apache.

the class ExternalDatasetIndexesRecoverOperatorDescriptor method performOpOnIndex.

@Override
protected void performOpOnIndex(IIndexDataflowHelper indexDataflowHelper, IHyracksTaskContext ctx) throws HyracksDataException {
    String path = indexDataflowHelper.getResource().getPath();
    IIOManager ioManager = ctx.getIoManager();
    FileReference file = ioManager.resolve(path);
    AbortRecoverLSMIndexFileManager fileManager = new AbortRecoverLSMIndexFileManager(ctx.getIoManager(), file);
    fileManager.recoverTransaction();
}
Also used : AbortRecoverLSMIndexFileManager(org.apache.hyracks.storage.am.lsm.common.impls.AbortRecoverLSMIndexFileManager) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager)

Example 4 with IIOManager

use of org.apache.hyracks.api.io.IIOManager in project asterixdb by apache.

the class LSMInvertedIndexLocalResource method createInstance.

@Override
public ILSMIndex createInstance(INCServiceContext serviceCtx) throws HyracksDataException {
    IIOManager ioManager = serviceCtx.getIoManager();
    FileReference file = ioManager.resolve(path);
    List<IVirtualBufferCache> virtualBufferCaches = vbcProvider.getVirtualBufferCaches(serviceCtx, file);
    IBufferCache bufferCache = storageManager.getBufferCache(serviceCtx);
    IFileMapProvider fileMapManager = storageManager.getFileMapProvider(serviceCtx);
    ILSMMergePolicy mergePolicy = mergePolicyFactory.createMergePolicy(mergePolicyProperties, serviceCtx);
    ILSMIOOperationScheduler ioScheduler = ioSchedulerProvider.getIoScheduler(serviceCtx);
    if (isPartitioned) {
        return InvertedIndexUtils.createPartitionedLSMInvertedIndex(ioManager, virtualBufferCaches, fileMapManager, typeTraits, cmpFactories, tokenTypeTraits, tokenCmpFactories, tokenizerFactory, bufferCache, file.getAbsolutePath(), bloomFilterFalsePositiveRate, mergePolicy, opTrackerProvider.getOperationTracker(serviceCtx), ioScheduler, ioOpCallbackFactory.createIoOpCallback(), invertedIndexFields, filterTypeTraits, filterCmpFactories, filterFields, filterFieldsForNonBulkLoadOps, invertedIndexFieldsForNonBulkLoadOps, durable, metadataPageManagerFactory);
    } else {
        return InvertedIndexUtils.createLSMInvertedIndex(ioManager, virtualBufferCaches, fileMapManager, typeTraits, cmpFactories, tokenTypeTraits, tokenCmpFactories, tokenizerFactory, bufferCache, file.getAbsolutePath(), bloomFilterFalsePositiveRate, mergePolicy, opTrackerProvider.getOperationTracker(serviceCtx), ioScheduler, ioOpCallbackFactory.createIoOpCallback(), invertedIndexFields, filterTypeTraits, filterCmpFactories, filterFields, filterFieldsForNonBulkLoadOps, invertedIndexFieldsForNonBulkLoadOps, durable, metadataPageManagerFactory);
    }
}
Also used : IFileMapProvider(org.apache.hyracks.storage.common.file.IFileMapProvider) ILSMIOOperationScheduler(org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager) ILSMMergePolicy(org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicy) IBufferCache(org.apache.hyracks.storage.common.buffercache.IBufferCache)

Example 5 with IIOManager

use of org.apache.hyracks.api.io.IIOManager in project asterixdb by apache.

the class LSMRTreeLocalResource method createInstance.

@Override
public IIndex createInstance(INCServiceContext ncServiceCtx) throws HyracksDataException {
    IIOManager ioManager = ncServiceCtx.getIoManager();
    FileReference fileRef = ioManager.resolve(path);
    List<IVirtualBufferCache> virtualBufferCaches = vbcProvider.getVirtualBufferCaches(ncServiceCtx, fileRef);
    return LSMRTreeUtils.createLSMTree(ioManager, virtualBufferCaches, fileRef, storageManager.getBufferCache(ncServiceCtx), storageManager.getFileMapProvider(ncServiceCtx), typeTraits, cmpFactories, btreeCmpFactories, valueProviderFactories, rtreePolicyType, bloomFilterFalsePositiveRate, mergePolicyFactory.createMergePolicy(mergePolicyProperties, ncServiceCtx), opTrackerProvider.getOperationTracker(ncServiceCtx), ioSchedulerProvider.getIoScheduler(ncServiceCtx), ioOpCallbackFactory.createIoOpCallback(), linearizeCmpFactory, rtreeFields, buddyBTreeFields, filterTypeTraits, filterCmpFactories, filterFields, durable, isPointMBR, metadataPageManagerFactory);
}
Also used : IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager)

Aggregations

IIOManager (org.apache.hyracks.api.io.IIOManager)22 FileReference (org.apache.hyracks.api.io.FileReference)16 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)7 IBufferCache (org.apache.hyracks.storage.common.buffercache.IBufferCache)6 IFileMapProvider (org.apache.hyracks.storage.common.file.IFileMapProvider)5 FileSplit (org.apache.hyracks.api.io.FileSplit)4 IVirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache)4 IOException (java.io.IOException)3 Test (org.junit.Test)3 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 ByteBuffer (java.nio.ByteBuffer)2 ArrayList (java.util.ArrayList)2 RecordDescriptor (org.apache.hyracks.api.dataflow.value.RecordDescriptor)2 AbstractUnaryInputSinkOperatorNodePushable (org.apache.hyracks.dataflow.std.base.AbstractUnaryInputSinkOperatorNodePushable)2 AbortRecoverLSMIndexFileManager (org.apache.hyracks.storage.am.lsm.common.impls.AbortRecoverLSMIndexFileManager)2 ICachedPage (org.apache.hyracks.storage.common.buffercache.ICachedPage)2 BufferedWriter (java.io.BufferedWriter)1 DataInputStream (java.io.DataInputStream)1 DataOutput (java.io.DataOutput)1