Search in sources :

Example 1 with IndexCreateOperatorDescriptor

use of org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor in project asterixdb by apache.

the class SecondaryTreeIndexOperationsHelper method buildCreationJobSpec.

@Override
public JobSpecification buildCreationJobSpec() throws AlgebricksException {
    JobSpecification spec = RuntimeUtils.createJobSpecification(metadataProvider.getApplicationContext());
    IStorageComponentProvider storageComponentProvider = metadataProvider.getStorageComponentProvider();
    IResourceFactory resourceFactory = dataset.getResourceFactory(metadataProvider, index, itemType, metaType, mergePolicyFactory, mergePolicyProperties);
    IIndexBuilderFactory indexBuilderFactory = new IndexBuilderFactory(storageComponentProvider.getStorageManager(), secondaryFileSplitProvider, resourceFactory, !dataset.isTemp());
    IndexCreateOperatorDescriptor secondaryIndexCreateOp = new IndexCreateOperatorDescriptor(spec, indexBuilderFactory);
    AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(spec, secondaryIndexCreateOp, secondaryPartitionConstraint);
    spec.addRoot(secondaryIndexCreateOp);
    spec.setConnectorPolicyAssignmentPolicy(new ConnectorPolicyAssignmentPolicy());
    return spec;
}
Also used : IStorageComponentProvider(org.apache.asterix.common.context.IStorageComponentProvider) ConnectorPolicyAssignmentPolicy(org.apache.hyracks.algebricks.core.jobgen.impl.ConnectorPolicyAssignmentPolicy) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IndexBuilderFactory(org.apache.hyracks.storage.am.common.build.IndexBuilderFactory) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IResourceFactory(org.apache.hyracks.storage.common.IResourceFactory) IndexCreateOperatorDescriptor(org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)

Example 2 with IndexCreateOperatorDescriptor

use of org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor in project asterixdb by apache.

the class AbstractBTreeOperatorTest method createSecondaryIndex.

public void createSecondaryIndex() throws Exception {
    JobSpecification spec = new JobSpecification();
    IResourceFactory secondaryResourceFactory = createSecondaryResourceFactory();
    IIndexBuilderFactory indexBuilderFactory = new IndexBuilderFactory(storageManager, secondarySplitProvider, secondaryResourceFactory, false);
    IndexCreateOperatorDescriptor secondaryCreateOp = new IndexCreateOperatorDescriptor(spec, indexBuilderFactory);
    PartitionConstraintHelper.addAbsoluteLocationConstraint(spec, secondaryCreateOp, NC1_ID);
    spec.addRoot(secondaryCreateOp);
    runTest(spec);
}
Also used : IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IndexBuilderFactory(org.apache.hyracks.storage.am.common.build.IndexBuilderFactory) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IResourceFactory(org.apache.hyracks.storage.common.IResourceFactory) IndexCreateOperatorDescriptor(org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)

Example 3 with IndexCreateOperatorDescriptor

use of org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor in project asterixdb by apache.

the class AbstractBTreeOperatorTest method createPrimaryIndex.

public void createPrimaryIndex() throws Exception {
    JobSpecification spec = new JobSpecification();
    IResourceFactory primaryResourceFactory = createPrimaryResourceFactory();
    IIndexBuilderFactory indexBuilderFactory = new IndexBuilderFactory(storageManager, primarySplitProvider, primaryResourceFactory, false);
    IndexCreateOperatorDescriptor primaryCreateOp = new IndexCreateOperatorDescriptor(spec, indexBuilderFactory);
    PartitionConstraintHelper.addAbsoluteLocationConstraint(spec, primaryCreateOp, NC1_ID);
    spec.addRoot(primaryCreateOp);
    runTest(spec);
}
Also used : IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IndexBuilderFactory(org.apache.hyracks.storage.am.common.build.IndexBuilderFactory) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IResourceFactory(org.apache.hyracks.storage.common.IResourceFactory) IndexCreateOperatorDescriptor(org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)

Example 4 with IndexCreateOperatorDescriptor

use of org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor in project asterixdb by apache.

the class AbstractRTreeOperatorTest method createSecondaryIndex.

protected void createSecondaryIndex() throws Exception {
    JobSpecification spec = new JobSpecification();
    IndexBuilderFactory indexBuilderFactory = new IndexBuilderFactory(storageManager, secondarySplitProvider, rtreeFactory, false);
    IndexCreateOperatorDescriptor secondaryCreateOp = new IndexCreateOperatorDescriptor(spec, indexBuilderFactory);
    PartitionConstraintHelper.addAbsoluteLocationConstraint(spec, secondaryCreateOp, NC1_ID);
    spec.addRoot(secondaryCreateOp);
    runTest(spec);
}
Also used : IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IndexBuilderFactory(org.apache.hyracks.storage.am.common.build.IndexBuilderFactory) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IndexCreateOperatorDescriptor(org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)

Example 5 with IndexCreateOperatorDescriptor

use of org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor in project asterixdb by apache.

the class AbstractRTreeOperatorTest method createPrimaryIndex.

protected void createPrimaryIndex() throws Exception {
    JobSpecification spec = new JobSpecification();
    btreeFactory = new BTreeResourceFactory(storageManager, primaryTypeTraits, primaryComparatorFactories, pageManagerFactory);
    IIndexBuilderFactory indexBuilderFactory = new IndexBuilderFactory(storageManager, primarySplitProvider, btreeFactory, false);
    IndexCreateOperatorDescriptor primaryCreateOp = new IndexCreateOperatorDescriptor(spec, indexBuilderFactory);
    PartitionConstraintHelper.addAbsoluteLocationConstraint(spec, primaryCreateOp, NC1_ID);
    spec.addRoot(primaryCreateOp);
    runTest(spec);
}
Also used : BTreeResourceFactory(org.apache.hyracks.storage.am.btree.dataflow.BTreeResourceFactory) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IIndexBuilderFactory(org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory) IndexBuilderFactory(org.apache.hyracks.storage.am.common.build.IndexBuilderFactory) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IndexCreateOperatorDescriptor(org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)

Aggregations

JobSpecification (org.apache.hyracks.api.job.JobSpecification)6 IndexBuilderFactory (org.apache.hyracks.storage.am.common.build.IndexBuilderFactory)6 IndexCreateOperatorDescriptor (org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor)6 IIndexBuilderFactory (org.apache.hyracks.storage.am.common.api.IIndexBuilderFactory)5 IResourceFactory (org.apache.hyracks.storage.common.IResourceFactory)4 Map (java.util.Map)1 IStorageComponentProvider (org.apache.asterix.common.context.IStorageComponentProvider)1 Index (org.apache.asterix.metadata.entities.Index)1 ARecordType (org.apache.asterix.om.types.ARecordType)1 AlgebricksPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint)1 ConnectorPolicyAssignmentPolicy (org.apache.hyracks.algebricks.core.jobgen.impl.ConnectorPolicyAssignmentPolicy)1 FileSplit (org.apache.hyracks.api.io.FileSplit)1 IFileSplitProvider (org.apache.hyracks.dataflow.std.file.IFileSplitProvider)1 BTreeResourceFactory (org.apache.hyracks.storage.am.btree.dataflow.BTreeResourceFactory)1 ILSMMergePolicyFactory (org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicyFactory)1