You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by sj...@apache.org on 2016/12/16 18:12:01 UTC
[15/23] asterixdb git commit: ASTERIXDB-1711: remove more mentions of
Asterix
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/TransactionSubsystemProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/TransactionSubsystemProvider.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/TransactionSubsystemProvider.java
index e464667..706c303 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/TransactionSubsystemProvider.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/TransactionSubsystemProvider.java
@@ -19,7 +19,7 @@
package org.apache.asterix.common.context;
-import org.apache.asterix.common.api.IAsterixAppRuntimeContext;
+import org.apache.asterix.common.api.IAppRuntimeContext;
import org.apache.asterix.common.transactions.ITransactionSubsystem;
import org.apache.hyracks.api.context.IHyracksTaskContext;
@@ -33,7 +33,7 @@ public class TransactionSubsystemProvider implements ITransactionSubsystemProvid
@Override
public ITransactionSubsystem getTransactionSubsystem(IHyracksTaskContext ctx) {
- IAsterixAppRuntimeContext runtimeCtx = (IAsterixAppRuntimeContext) ctx.getJobletContext()
+ IAppRuntimeContext runtimeCtx = (IAppRuntimeContext) ctx.getJobletContext()
.getApplicationContext().getApplicationObject();
return runtimeCtx.getTransactionSubsystem();
}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMIndexUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMIndexUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMIndexUtil.java
deleted file mode 100644
index 45362ef..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMIndexUtil.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.dataflow;
-
-import org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback;
-import org.apache.asterix.common.transactions.ILogManager;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
-import org.apache.hyracks.storage.am.common.freepage.AppendOnlyLinkedMetadataPageManagerFactory;
-import org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent;
-import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex;
-
-public class AsterixLSMIndexUtil {
-
- public static void checkAndSetFirstLSN(AbstractLSMIndex lsmIndex, ILogManager logManager)
- throws HyracksDataException {
- // If the index has an empty memory component, we need to set its first LSN (For soft checkpoint)
- if (lsmIndex.isCurrentMutableComponentEmpty()) {
- //prevent transactions from incorrectly setting the first LSN on a modified component by checking the index is still empty
- synchronized (lsmIndex.getOperationTracker()) {
- if (lsmIndex.isCurrentMutableComponentEmpty()) {
- AbstractLSMIOOperationCallback ioOpCallback = (AbstractLSMIOOperationCallback) lsmIndex
- .getIOOperationCallback();
- ioOpCallback.setFirstLSN(logManager.getAppendLSN());
- }
- }
- }
- }
-
- public static long getComponentFileLSNOffset(AbstractLSMIndex lsmIndex, ILSMComponent lsmComponent,
- String componentFilePath) throws HyracksDataException {
- AbstractLSMIOOperationCallback ioOpCallback = (AbstractLSMIOOperationCallback) lsmIndex
- .getIOOperationCallback();
- return ioOpCallback.getComponentFileLSNOffset(lsmComponent, componentFilePath);
- }
-
- public static IMetadataPageManagerFactory getMetadataPageManagerFactory() {
- return new AppendOnlyLinkedMetadataPageManagerFactory();
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java
deleted file mode 100644
index 9ebb5f2..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.dataflow;
-
-import java.nio.ByteBuffer;
-
-import org.apache.asterix.common.api.IAsterixAppRuntimeContext;
-import org.apache.asterix.common.transactions.ILogMarkerCallback;
-import org.apache.asterix.common.transactions.PrimaryIndexLogMarkerCallback;
-import org.apache.hyracks.api.comm.VSizeFrame;
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
-import org.apache.hyracks.api.exceptions.ErrorCode;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
-import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender;
-import org.apache.hyracks.dataflow.common.comm.util.FrameUtils;
-import org.apache.hyracks.dataflow.common.data.accessors.FrameTupleReference;
-import org.apache.hyracks.dataflow.common.util.TaskUtils;
-import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
-import org.apache.hyracks.storage.am.common.dataflow.IIndexOperatorDescriptor;
-import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallback;
-import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexAccessor;
-import org.apache.hyracks.storage.am.lsm.common.dataflow.LSMIndexInsertUpdateDeleteOperatorNodePushable;
-import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex;
-
-public class AsterixLSMInsertDeleteOperatorNodePushable extends LSMIndexInsertUpdateDeleteOperatorNodePushable {
-
- public static final String KEY_INDEX = "Index";
- private final boolean isPrimary;
- // This class has both lsmIndex and index (in super class) pointing to the same object
- private AbstractLSMIndex lsmIndex;
- private int i = 0;
-
- /**
- * The following three variables are used to keep track of the information regarding flushing partial frame such as
- * 1. whether there was a partial frame flush for the current frame,
- * ==> captured in flushedPartialTuples variable
- * 2. the last flushed tuple index in the frame if there was a partial frame flush,
- * ==> captured in lastFlushedTupleIdx variable
- * 3. the current tuple index the frame, where this operator is working on the current tuple.
- * ==> captured in currentTupleIdx variable
- * These variables are reset for each frame, i.e., whenever nextFrame() is called, these variables are reset.
- */
- private boolean flushedPartialTuples;
- private int currentTupleIdx;
- private int lastFlushedTupleIdx;
-
- public AsterixLSMInsertDeleteOperatorNodePushable(IIndexOperatorDescriptor opDesc, IHyracksTaskContext ctx,
- int partition, int[] fieldPermutation, IRecordDescriptorProvider recordDescProvider, IndexOperation op,
- boolean isPrimary) throws HyracksDataException {
- super(opDesc, ctx, partition, fieldPermutation, recordDescProvider, op);
- this.isPrimary = isPrimary;
- }
-
- @Override
- public void open() throws HyracksDataException {
- RecordDescriptor inputRecDesc = recordDescProvider.getInputRecordDescriptor(opDesc.getActivityId(), 0);
- accessor = new FrameTupleAccessor(inputRecDesc);
- writeBuffer = new VSizeFrame(ctx);
- appender = new FrameTupleAppender(writeBuffer);
- indexHelper.open();
- lsmIndex = (AbstractLSMIndex) indexHelper.getIndexInstance();
- try {
- if (isPrimary && ctx.getSharedObject() != null) {
- PrimaryIndexLogMarkerCallback callback = new PrimaryIndexLogMarkerCallback(lsmIndex);
- TaskUtils.putInSharedMap(ILogMarkerCallback.KEY_MARKER_CALLBACK, callback, ctx);
- }
- writer.open();
- modCallback = opDesc.getModificationOpCallbackFactory().createModificationOperationCallback(
- indexHelper.getResource(), ctx, this);
- indexAccessor = lsmIndex.createAccessor(modCallback, NoOpOperationCallback.INSTANCE);
- ITupleFilterFactory tupleFilterFactory = opDesc.getTupleFilterFactory();
- if (tupleFilterFactory != null) {
- tupleFilter = tupleFilterFactory.createTupleFilter(ctx);
- frameTuple = new FrameTupleReference();
- }
- IAsterixAppRuntimeContext runtimeCtx =
- (IAsterixAppRuntimeContext) ctx.getJobletContext().getApplicationContext().getApplicationObject();
- AsterixLSMIndexUtil.checkAndSetFirstLSN(lsmIndex, runtimeCtx.getTransactionSubsystem().getLogManager());
- } catch (Throwable th) {
- throw new HyracksDataException(th);
- }
- }
-
- @Override
- public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
- currentTupleIdx = 0;
- lastFlushedTupleIdx = 0;
- flushedPartialTuples = false;
-
- accessor.reset(buffer);
- ILSMIndexAccessor lsmAccessor = (ILSMIndexAccessor) indexAccessor;
- int tupleCount = accessor.getTupleCount();
- try {
- for (; i < tupleCount; i++, currentTupleIdx++) {
- if (tupleFilter != null) {
- frameTuple.reset(accessor, i);
- if (!tupleFilter.accept(frameTuple)) {
- continue;
- }
- }
- tuple.reset(accessor, i);
- switch (op) {
- case INSERT:
- if (i == 0 && isPrimary) {
- lsmAccessor.insert(tuple);
- } else {
- lsmAccessor.forceInsert(tuple);
- }
- break;
- case DELETE:
- if (i == 0 && isPrimary) {
- lsmAccessor.delete(tuple);
- } else {
- lsmAccessor.forceDelete(tuple);
- }
- break;
- default: {
- throw new HyracksDataException("Unsupported operation %1$s in %2$s operator",
- ErrorCode.INVALID_OPERATOR_OPERATION, op.toString(),
- AsterixLSMInsertDeleteOperatorNodePushable.class.getSimpleName());
- }
- }
- }
- } catch (HyracksDataException e) {
- if (e.getErrorCode() == ErrorCode.INVALID_OPERATOR_OPERATION) {
- throw e;
- } else {
- throw new HyracksDataException(e, ErrorCode.ERROR_PROCESSING_TUPLE, i);
- }
- } catch (Exception e) {
- throw new HyracksDataException(e, ErrorCode.ERROR_PROCESSING_TUPLE, i);
- }
-
- writeBuffer.ensureFrameSize(buffer.capacity());
- if (flushedPartialTuples) {
- flushPartialFrame();
- } else {
- FrameUtils.copyAndFlip(buffer, writeBuffer.getBuffer());
- FrameUtils.flushFrame(writeBuffer.getBuffer(), writer);
- }
- i = 0;
- }
-
- /**
- * flushes tuples in a frame from lastFlushedTupleIdx(inclusive) to currentTupleIdx(exclusive)
- */
- @Override
- public void flushPartialFrame() throws HyracksDataException {
- if (lastFlushedTupleIdx == currentTupleIdx) {
- //nothing to flush
- return;
- }
- for (int i = lastFlushedTupleIdx; i < currentTupleIdx; i++) {
- FrameUtils.appendToWriter(writer, appender, accessor, i);
- }
- appender.write(writer, true);
- lastFlushedTupleIdx = currentTupleIdx;
- flushedPartialTuples = true;
- }
-
- @Override
- public void close() throws HyracksDataException {
- if (lsmIndex != null) {
- try {
- indexHelper.close();
- } finally {
- writer.close();
- }
- }
- }
-
- @Override
- public void fail() throws HyracksDataException {
- if (lsmIndex != null) {
- writer.fail();
- }
- }
-
- public boolean isPrimary() {
- return isPrimary;
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor.java
deleted file mode 100644
index e7802b9..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.dataflow;
-
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.dataflow.IOperatorNodePushable;
-import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import org.apache.hyracks.api.dataflow.value.ITypeTraits;
-import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
-import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
-import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
-import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
-import org.apache.hyracks.storage.am.common.api.IModificationOperationCallbackFactory;
-import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
-import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
-import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.am.lsm.invertedindex.dataflow.LSMInvertedIndexInsertUpdateDeleteOperator;
-import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
-
-public class AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor extends LSMInvertedIndexInsertUpdateDeleteOperator {
-
- private static final long serialVersionUID = 1L;
-
- private final String indexName;
-
- public AsterixLSMInvertedIndexInsertDeleteOperatorDescriptor(IOperatorDescriptorRegistry spec,
- RecordDescriptor recDesc, IStorageManagerInterface storageManager, IFileSplitProvider fileSplitProvider,
- IIndexLifecycleManagerProvider lifecycleManagerProvider, ITypeTraits[] tokenTypeTraits,
- IBinaryComparatorFactory[] tokenComparatorFactories, ITypeTraits[] invListsTypeTraits,
- IBinaryComparatorFactory[] invListComparatorFactories, IBinaryTokenizerFactory tokenizerFactory,
- int[] fieldPermutation, IndexOperation op, IIndexDataflowHelperFactory dataflowHelperFactory,
- ITupleFilterFactory tupleFilterFactory,
- IModificationOperationCallbackFactory modificationOpCallbackFactory, String indexName,
- IMetadataPageManagerFactory metadataPageManagerFactory) {
- super(spec, recDesc, storageManager, fileSplitProvider, lifecycleManagerProvider, tokenTypeTraits,
- tokenComparatorFactories, invListsTypeTraits, invListComparatorFactories, tokenizerFactory,
- fieldPermutation, op, dataflowHelperFactory, tupleFilterFactory, modificationOpCallbackFactory,
- metadataPageManagerFactory);
- this.indexName = indexName;
- }
-
- @Override
- public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
- IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException {
- return new AsterixLSMInsertDeleteOperatorNodePushable(this, ctx, partition, fieldPermutation,
- recordDescProvider, op, false);
- }
-
- public String getIndexName() {
- return indexName;
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMTreeInsertDeleteOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMTreeInsertDeleteOperatorDescriptor.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMTreeInsertDeleteOperatorDescriptor.java
deleted file mode 100644
index 177a943..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMTreeInsertDeleteOperatorDescriptor.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.dataflow;
-
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.dataflow.IOperatorNodePushable;
-import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-import org.apache.hyracks.api.dataflow.value.IMissingWriterFactory;
-import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import org.apache.hyracks.api.dataflow.value.ITypeTraits;
-import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
-import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
-import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
-import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
-import org.apache.hyracks.storage.am.common.api.IModificationOperationCallbackFactory;
-import org.apache.hyracks.storage.am.common.api.ISearchOperationCallbackFactory;
-import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
-import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
-import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.am.lsm.common.dataflow.LSMTreeIndexInsertUpdateDeleteOperatorDescriptor;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
-
-public class AsterixLSMTreeInsertDeleteOperatorDescriptor extends LSMTreeIndexInsertUpdateDeleteOperatorDescriptor {
-
- private static final long serialVersionUID = 1L;
-
- private final boolean isPrimary;
-
- /** the name of the index that is being operated upon **/
- private final String indexName;
-
- public AsterixLSMTreeInsertDeleteOperatorDescriptor(IOperatorDescriptorRegistry spec, RecordDescriptor recDesc,
- IStorageManagerInterface storageManager, IIndexLifecycleManagerProvider lifecycleManagerProvider,
- IFileSplitProvider fileSplitProvider, ITypeTraits[] typeTraits,
- IBinaryComparatorFactory[] comparatorFactories, int[] bloomFilterKeyFields, int[] fieldPermutation,
- IndexOperation op, IIndexDataflowHelperFactory dataflowHelperFactory,
- ITupleFilterFactory tupleFilterFactory, boolean isPrimary, String indexName,
- IMissingWriterFactory nullWriterFactory,
- IModificationOperationCallbackFactory modificationOpCallbackProvider,
- ISearchOperationCallbackFactory searchOpCallbackProvider,
- IMetadataPageManagerFactory metadataPageManagerFactory) {
- super(spec, recDesc, storageManager, lifecycleManagerProvider, fileSplitProvider, typeTraits,
- comparatorFactories, bloomFilterKeyFields, fieldPermutation, op, dataflowHelperFactory,
- tupleFilterFactory, nullWriterFactory, modificationOpCallbackProvider, searchOpCallbackProvider,
- metadataPageManagerFactory);
- this.isPrimary = isPrimary;
- this.indexName = indexName;
- }
-
- @Override
- public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
- IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException {
- return new AsterixLSMInsertDeleteOperatorNodePushable(this, ctx, partition, fieldPermutation,
- recordDescProvider, op, isPrimary);
- }
-
- public boolean isPrimary() {
- return isPrimary;
- }
-
- public String getIndexName() {
- return indexName;
- }
-
- public int[] getFieldPermutations() {
- return fieldPermutation;
- }
-
- public IndexOperation getIndexOperation() {
- return op;
- }
-
- public IBinaryComparatorFactory[] getComparatorFactories() {
- return comparatorFactories;
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IApplicationContextInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IApplicationContextInfo.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IApplicationContextInfo.java
new file mode 100644
index 0000000..b9d547f
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IApplicationContextInfo.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.dataflow;
+
+import org.apache.asterix.common.cluster.IGlobalRecoveryMaanger;
+import org.apache.asterix.common.library.ILibraryManager;
+import org.apache.hyracks.api.application.ICCApplicationContext;
+import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
+import org.apache.hyracks.storage.common.IStorageManagerInterface;
+
+/**
+ * Provides methods for obtaining the IIndexLifecycleManagerProvider, IStorageManagerInterface and
+ * ICCApplicationContext implementation.
+ */
+public interface IApplicationContextInfo {
+
+ /**
+ * Returns an instance of the implementation for IIndexLifecycleManagerProvider.
+ *
+ * @return IIndexLifecycleManagerProvider implementation instance
+ */
+ public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider();
+
+ /**
+ * Returns an instance of the implementation for IStorageManagerInterface.
+ *
+ * @return IStorageManagerInterface implementation instance
+ */
+ public IStorageManagerInterface getStorageManagerInterface();
+
+ /**
+ * Returns an instance of the implementation for ICCApplicationContext.
+ *
+ * @return ICCApplicationContext implementation instance
+ */
+ public ICCApplicationContext getCCApplicationContext();
+
+ /**
+ * @return the global recovery manager.
+ */
+ public IGlobalRecoveryMaanger getGlobalRecoveryManager();
+
+ /**
+ * @return the library manager (at CC side).
+ */
+ public ILibraryManager getLibraryManager();
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IAsterixApplicationContextInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IAsterixApplicationContextInfo.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IAsterixApplicationContextInfo.java
deleted file mode 100644
index 57fb335..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/IAsterixApplicationContextInfo.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.dataflow;
-
-import org.apache.asterix.common.cluster.IGlobalRecoveryMaanger;
-import org.apache.asterix.common.library.ILibraryManager;
-import org.apache.hyracks.api.application.ICCApplicationContext;
-import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
-
-/**
- * Provides methods for obtaining the IIndexLifecycleManagerProvider, IStorageManagerInterface and
- * ICCApplicationContext implementation.
- */
-public interface IAsterixApplicationContextInfo {
-
- /**
- * Returns an instance of the implementation for IIndexLifecycleManagerProvider.
- *
- * @return IIndexLifecycleManagerProvider implementation instance
- */
- public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider();
-
- /**
- * Returns an instance of the implementation for IStorageManagerInterface.
- *
- * @return IStorageManagerInterface implementation instance
- */
- public IStorageManagerInterface getStorageManagerInterface();
-
- /**
- * Returns an instance of the implementation for ICCApplicationContext.
- *
- * @return ICCApplicationContext implementation instance
- */
- public ICCApplicationContext getCCApplicationContext();
-
- /**
- * @return the global recovery manager.
- */
- public IGlobalRecoveryMaanger getGlobalRecoveryManager();
-
- /**
- * @return the library manager (at CC side).
- */
- public ILibraryManager getLibraryManager();
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMIndexUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMIndexUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMIndexUtil.java
new file mode 100644
index 0000000..27bb14f
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMIndexUtil.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.dataflow;
+
+import org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback;
+import org.apache.asterix.common.transactions.ILogManager;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
+import org.apache.hyracks.storage.am.common.freepage.AppendOnlyLinkedMetadataPageManagerFactory;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent;
+import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex;
+
+public class LSMIndexUtil {
+
+ public static void checkAndSetFirstLSN(AbstractLSMIndex lsmIndex, ILogManager logManager)
+ throws HyracksDataException {
+ // If the index has an empty memory component, we need to set its first LSN (For soft checkpoint)
+ if (lsmIndex.isCurrentMutableComponentEmpty()) {
+ //prevent transactions from incorrectly setting the first LSN on a modified component by checking the index is still empty
+ synchronized (lsmIndex.getOperationTracker()) {
+ if (lsmIndex.isCurrentMutableComponentEmpty()) {
+ AbstractLSMIOOperationCallback ioOpCallback = (AbstractLSMIOOperationCallback) lsmIndex
+ .getIOOperationCallback();
+ ioOpCallback.setFirstLSN(logManager.getAppendLSN());
+ }
+ }
+ }
+ }
+
+ public static long getComponentFileLSNOffset(AbstractLSMIndex lsmIndex, ILSMComponent lsmComponent,
+ String componentFilePath) throws HyracksDataException {
+ AbstractLSMIOOperationCallback ioOpCallback = (AbstractLSMIOOperationCallback) lsmIndex
+ .getIOOperationCallback();
+ return ioOpCallback.getComponentFileLSNOffset(lsmComponent, componentFilePath);
+ }
+
+ public static IMetadataPageManagerFactory getMetadataPageManagerFactory() {
+ return new AppendOnlyLinkedMetadataPageManagerFactory();
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
new file mode 100644
index 0000000..f17fcaf
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.dataflow;
+
+import java.nio.ByteBuffer;
+
+import org.apache.asterix.common.api.IAppRuntimeContext;
+import org.apache.asterix.common.transactions.ILogMarkerCallback;
+import org.apache.asterix.common.transactions.PrimaryIndexLogMarkerCallback;
+import org.apache.hyracks.api.comm.VSizeFrame;
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.ErrorCode;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
+import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender;
+import org.apache.hyracks.dataflow.common.comm.util.FrameUtils;
+import org.apache.hyracks.dataflow.common.data.accessors.FrameTupleReference;
+import org.apache.hyracks.dataflow.common.util.TaskUtils;
+import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
+import org.apache.hyracks.storage.am.common.dataflow.IIndexOperatorDescriptor;
+import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallback;
+import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexAccessor;
+import org.apache.hyracks.storage.am.lsm.common.dataflow.LSMIndexInsertUpdateDeleteOperatorNodePushable;
+import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex;
+
+public class LSMInsertDeleteOperatorNodePushable extends LSMIndexInsertUpdateDeleteOperatorNodePushable {
+
+ public static final String KEY_INDEX = "Index";
+ private final boolean isPrimary;
+ // This class has both lsmIndex and index (in super class) pointing to the same object
+ private AbstractLSMIndex lsmIndex;
+ private int i = 0;
+
+ /**
+ * The following three variables are used to keep track of the information regarding flushing partial frame such as
+ * 1. whether there was a partial frame flush for the current frame,
+ * ==> captured in flushedPartialTuples variable
+ * 2. the last flushed tuple index in the frame if there was a partial frame flush,
+ * ==> captured in lastFlushedTupleIdx variable
+ * 3. the current tuple index the frame, where this operator is working on the current tuple.
+ * ==> captured in currentTupleIdx variable
+ * These variables are reset for each frame, i.e., whenever nextFrame() is called, these variables are reset.
+ */
+ private boolean flushedPartialTuples;
+ private int currentTupleIdx;
+ private int lastFlushedTupleIdx;
+
+ public LSMInsertDeleteOperatorNodePushable(IIndexOperatorDescriptor opDesc, IHyracksTaskContext ctx,
+ int partition, int[] fieldPermutation, IRecordDescriptorProvider recordDescProvider, IndexOperation op,
+ boolean isPrimary) throws HyracksDataException {
+ super(opDesc, ctx, partition, fieldPermutation, recordDescProvider, op);
+ this.isPrimary = isPrimary;
+ }
+
+ @Override
+ public void open() throws HyracksDataException {
+ RecordDescriptor inputRecDesc = recordDescProvider.getInputRecordDescriptor(opDesc.getActivityId(), 0);
+ accessor = new FrameTupleAccessor(inputRecDesc);
+ writeBuffer = new VSizeFrame(ctx);
+ appender = new FrameTupleAppender(writeBuffer);
+ indexHelper.open();
+ lsmIndex = (AbstractLSMIndex) indexHelper.getIndexInstance();
+ try {
+ if (isPrimary && ctx.getSharedObject() != null) {
+ PrimaryIndexLogMarkerCallback callback = new PrimaryIndexLogMarkerCallback(lsmIndex);
+ TaskUtils.putInSharedMap(ILogMarkerCallback.KEY_MARKER_CALLBACK, callback, ctx);
+ }
+ writer.open();
+ modCallback = opDesc.getModificationOpCallbackFactory().createModificationOperationCallback(
+ indexHelper.getResource(), ctx, this);
+ indexAccessor = lsmIndex.createAccessor(modCallback, NoOpOperationCallback.INSTANCE);
+ ITupleFilterFactory tupleFilterFactory = opDesc.getTupleFilterFactory();
+ if (tupleFilterFactory != null) {
+ tupleFilter = tupleFilterFactory.createTupleFilter(ctx);
+ frameTuple = new FrameTupleReference();
+ }
+ IAppRuntimeContext runtimeCtx =
+ (IAppRuntimeContext) ctx.getJobletContext().getApplicationContext().getApplicationObject();
+ LSMIndexUtil.checkAndSetFirstLSN(lsmIndex, runtimeCtx.getTransactionSubsystem().getLogManager());
+ } catch (Throwable th) {
+ throw new HyracksDataException(th);
+ }
+ }
+
+ @Override
+ public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
+ currentTupleIdx = 0;
+ lastFlushedTupleIdx = 0;
+ flushedPartialTuples = false;
+
+ accessor.reset(buffer);
+ ILSMIndexAccessor lsmAccessor = (ILSMIndexAccessor) indexAccessor;
+ int tupleCount = accessor.getTupleCount();
+ try {
+ for (; i < tupleCount; i++, currentTupleIdx++) {
+ if (tupleFilter != null) {
+ frameTuple.reset(accessor, i);
+ if (!tupleFilter.accept(frameTuple)) {
+ continue;
+ }
+ }
+ tuple.reset(accessor, i);
+ switch (op) {
+ case INSERT:
+ if (i == 0 && isPrimary) {
+ lsmAccessor.insert(tuple);
+ } else {
+ lsmAccessor.forceInsert(tuple);
+ }
+ break;
+ case DELETE:
+ if (i == 0 && isPrimary) {
+ lsmAccessor.delete(tuple);
+ } else {
+ lsmAccessor.forceDelete(tuple);
+ }
+ break;
+ default: {
+ throw new HyracksDataException("Unsupported operation %1$s in %2$s operator",
+ ErrorCode.INVALID_OPERATOR_OPERATION, op.toString(),
+ LSMInsertDeleteOperatorNodePushable.class.getSimpleName());
+ }
+ }
+ }
+ } catch (HyracksDataException e) {
+ if (e.getErrorCode() == ErrorCode.INVALID_OPERATOR_OPERATION) {
+ throw e;
+ } else {
+ throw new HyracksDataException(e, ErrorCode.ERROR_PROCESSING_TUPLE, i);
+ }
+ } catch (Exception e) {
+ throw new HyracksDataException(e, ErrorCode.ERROR_PROCESSING_TUPLE, i);
+ }
+
+ writeBuffer.ensureFrameSize(buffer.capacity());
+ if (flushedPartialTuples) {
+ flushPartialFrame();
+ } else {
+ FrameUtils.copyAndFlip(buffer, writeBuffer.getBuffer());
+ FrameUtils.flushFrame(writeBuffer.getBuffer(), writer);
+ }
+ i = 0;
+ }
+
+ /**
+ * flushes tuples in a frame from lastFlushedTupleIdx(inclusive) to currentTupleIdx(exclusive)
+ */
+ @Override
+ public void flushPartialFrame() throws HyracksDataException {
+ if (lastFlushedTupleIdx == currentTupleIdx) {
+ //nothing to flush
+ return;
+ }
+ for (int i = lastFlushedTupleIdx; i < currentTupleIdx; i++) {
+ FrameUtils.appendToWriter(writer, appender, accessor, i);
+ }
+ appender.write(writer, true);
+ lastFlushedTupleIdx = currentTupleIdx;
+ flushedPartialTuples = true;
+ }
+
+ @Override
+ public void close() throws HyracksDataException {
+ if (lsmIndex != null) {
+ try {
+ indexHelper.close();
+ } finally {
+ writer.close();
+ }
+ }
+ }
+
+ @Override
+ public void fail() throws HyracksDataException {
+ if (lsmIndex != null) {
+ writer.fail();
+ }
+ }
+
+ public boolean isPrimary() {
+ return isPrimary;
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInvertedIndexInsertDeleteOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInvertedIndexInsertDeleteOperatorDescriptor.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInvertedIndexInsertDeleteOperatorDescriptor.java
new file mode 100644
index 0000000..4a4502a
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInvertedIndexInsertDeleteOperatorDescriptor.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.dataflow;
+
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.dataflow.IOperatorNodePushable;
+import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
+import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
+import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
+import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
+import org.apache.hyracks.storage.am.common.api.IModificationOperationCallbackFactory;
+import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
+import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
+import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
+import org.apache.hyracks.storage.am.lsm.invertedindex.dataflow.LSMInvertedIndexInsertUpdateDeleteOperator;
+import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
+import org.apache.hyracks.storage.common.IStorageManagerInterface;
+
+public class LSMInvertedIndexInsertDeleteOperatorDescriptor extends LSMInvertedIndexInsertUpdateDeleteOperator {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String indexName;
+
+ public LSMInvertedIndexInsertDeleteOperatorDescriptor(IOperatorDescriptorRegistry spec,
+ RecordDescriptor recDesc, IStorageManagerInterface storageManager, IFileSplitProvider fileSplitProvider,
+ IIndexLifecycleManagerProvider lifecycleManagerProvider, ITypeTraits[] tokenTypeTraits,
+ IBinaryComparatorFactory[] tokenComparatorFactories, ITypeTraits[] invListsTypeTraits,
+ IBinaryComparatorFactory[] invListComparatorFactories, IBinaryTokenizerFactory tokenizerFactory,
+ int[] fieldPermutation, IndexOperation op, IIndexDataflowHelperFactory dataflowHelperFactory,
+ ITupleFilterFactory tupleFilterFactory,
+ IModificationOperationCallbackFactory modificationOpCallbackFactory, String indexName,
+ IMetadataPageManagerFactory metadataPageManagerFactory) {
+ super(spec, recDesc, storageManager, fileSplitProvider, lifecycleManagerProvider, tokenTypeTraits,
+ tokenComparatorFactories, invListsTypeTraits, invListComparatorFactories, tokenizerFactory,
+ fieldPermutation, op, dataflowHelperFactory, tupleFilterFactory, modificationOpCallbackFactory,
+ metadataPageManagerFactory);
+ this.indexName = indexName;
+ }
+
+ @Override
+ public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
+ IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException {
+ return new LSMInsertDeleteOperatorNodePushable(this, ctx, partition, fieldPermutation,
+ recordDescProvider, op, false);
+ }
+
+ public String getIndexName() {
+ return indexName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMTreeInsertDeleteOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMTreeInsertDeleteOperatorDescriptor.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMTreeInsertDeleteOperatorDescriptor.java
new file mode 100644
index 0000000..0f83dd3
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMTreeInsertDeleteOperatorDescriptor.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.dataflow;
+
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.dataflow.IOperatorNodePushable;
+import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import org.apache.hyracks.api.dataflow.value.IMissingWriterFactory;
+import org.apache.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
+import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
+import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
+import org.apache.hyracks.storage.am.common.api.IMetadataPageManagerFactory;
+import org.apache.hyracks.storage.am.common.api.IModificationOperationCallbackFactory;
+import org.apache.hyracks.storage.am.common.api.ISearchOperationCallbackFactory;
+import org.apache.hyracks.storage.am.common.api.ITupleFilterFactory;
+import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
+import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
+import org.apache.hyracks.storage.am.lsm.common.dataflow.LSMTreeIndexInsertUpdateDeleteOperatorDescriptor;
+import org.apache.hyracks.storage.common.IStorageManagerInterface;
+
+public class LSMTreeInsertDeleteOperatorDescriptor extends LSMTreeIndexInsertUpdateDeleteOperatorDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ private final boolean isPrimary;
+
+ /** the name of the index that is being operated upon **/
+ private final String indexName;
+
+ public LSMTreeInsertDeleteOperatorDescriptor(IOperatorDescriptorRegistry spec, RecordDescriptor recDesc,
+ IStorageManagerInterface storageManager, IIndexLifecycleManagerProvider lifecycleManagerProvider,
+ IFileSplitProvider fileSplitProvider, ITypeTraits[] typeTraits,
+ IBinaryComparatorFactory[] comparatorFactories, int[] bloomFilterKeyFields, int[] fieldPermutation,
+ IndexOperation op, IIndexDataflowHelperFactory dataflowHelperFactory,
+ ITupleFilterFactory tupleFilterFactory, boolean isPrimary, String indexName,
+ IMissingWriterFactory nullWriterFactory,
+ IModificationOperationCallbackFactory modificationOpCallbackProvider,
+ ISearchOperationCallbackFactory searchOpCallbackProvider,
+ IMetadataPageManagerFactory metadataPageManagerFactory) {
+ super(spec, recDesc, storageManager, lifecycleManagerProvider, fileSplitProvider, typeTraits,
+ comparatorFactories, bloomFilterKeyFields, fieldPermutation, op, dataflowHelperFactory,
+ tupleFilterFactory, nullWriterFactory, modificationOpCallbackProvider, searchOpCallbackProvider,
+ metadataPageManagerFactory);
+ this.isPrimary = isPrimary;
+ this.indexName = indexName;
+ }
+
+ @Override
+ public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
+ IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions) throws HyracksDataException {
+ return new LSMInsertDeleteOperatorNodePushable(this, ctx, partition, fieldPermutation,
+ recordDescProvider, op, isPrimary);
+ }
+
+ public boolean isPrimary() {
+ return isPrimary;
+ }
+
+ public String getIndexName() {
+ return indexName;
+ }
+
+ public int[] getFieldPermutations() {
+ return fieldPermutation;
+ }
+
+ public IndexOperation getIndexOperation() {
+ return op;
+ }
+
+ public IBinaryComparatorFactory[] getComparatorFactories() {
+ return comparatorFactories;
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/AsterixReplicationJob.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/AsterixReplicationJob.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/AsterixReplicationJob.java
deleted file mode 100644
index 038cf55..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/AsterixReplicationJob.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.replication;
-
-import java.util.Set;
-
-import org.apache.hyracks.api.replication.impl.AbstractReplicationJob;
-
-/**
- * LSMIndexReplicationJob is used for LSM Components only in Hyracks level.
- * AsterixReplicationJob is used for everything else.
- * Currently it is used to transfer indexes metadata files.
- */
-public class AsterixReplicationJob extends AbstractReplicationJob {
-
- public AsterixReplicationJob(ReplicationJobType jobType, ReplicationOperation operation,
- ReplicationExecutionType executionType, Set<String> filesToReplicate) {
- super(jobType, operation, executionType, filesToReplicate);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/Replica.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/Replica.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/Replica.java
index b8fe4b2..bd77778 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/Replica.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/Replica.java
@@ -25,7 +25,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
-import org.apache.asterix.common.config.AsterixReplicationProperties;
+import org.apache.asterix.common.config.ReplicationProperties;
import org.apache.asterix.event.schema.cluster.Node;
public class Replica {
@@ -59,7 +59,7 @@ public class Replica {
return node.getId();
}
- public InetSocketAddress getAddress(AsterixReplicationProperties asterixReplicationProperties) {
+ public InetSocketAddress getAddress(ReplicationProperties asterixReplicationProperties) {
String replicaIPAddress = node.getClusterIp();
int replicationPort = asterixReplicationProperties.getDataReplicationPort(node.getId());
return InetSocketAddress.createUnresolved(replicaIPAddress, replicationPort);
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ReplicationJob.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ReplicationJob.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ReplicationJob.java
new file mode 100644
index 0000000..f077332
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ReplicationJob.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.replication;
+
+import java.util.Set;
+
+import org.apache.hyracks.api.replication.impl.AbstractReplicationJob;
+
+/**
+ * LSMIndexReplicationJob is used for LSM Components only in Hyracks level.
+ * ReplicationJob is used for everything else.
+ * Currently it is used to transfer indexes metadata files.
+ */
+public class ReplicationJob extends AbstractReplicationJob {
+
+ public ReplicationJob(ReplicationJobType jobType, ReplicationOperation operation,
+ ReplicationExecutionType executionType, Set<String> filesToReplicate) {
+ super(jobType, operation, executionType, filesToReplicate);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAppRuntimeContextProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAppRuntimeContextProvider.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAppRuntimeContextProvider.java
new file mode 100644
index 0000000..4ff1f47
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAppRuntimeContextProvider.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.transactions;
+
+import org.apache.asterix.common.api.ThreadExecutor;
+import org.apache.asterix.common.api.IAppRuntimeContext;
+import org.apache.asterix.common.api.IDatasetLifecycleManager;
+import org.apache.hyracks.api.io.IIOManager;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMOperationTracker;
+import org.apache.hyracks.storage.common.buffercache.IBufferCache;
+import org.apache.hyracks.storage.common.file.IFileMapProvider;
+import org.apache.hyracks.storage.common.file.ILocalResourceRepository;
+
+public interface IAppRuntimeContextProvider {
+
+ public ThreadExecutor getThreadExecutor();
+
+ public IBufferCache getBufferCache();
+
+ public IFileMapProvider getFileMapManager();
+
+ public ITransactionSubsystem getTransactionSubsystem();
+
+ public IDatasetLifecycleManager getDatasetLifecycleManager();
+
+ public double getBloomFilterFalsePositiveRate();
+
+ public ILSMOperationTracker getLSMBTreeOperationTracker(int datasetID);
+
+ public ILSMIOOperationScheduler getLSMIOScheduler();
+
+ public ILocalResourceRepository getLocalResourceRepository();
+
+ public IIOManager getIOManager();
+
+ public IAppRuntimeContext getAppContext();
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixAppRuntimeContextProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixAppRuntimeContextProvider.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixAppRuntimeContextProvider.java
deleted file mode 100644
index b66bcf8..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixAppRuntimeContextProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.transactions;
-
-import org.apache.asterix.common.api.AsterixThreadExecutor;
-import org.apache.asterix.common.api.IAsterixAppRuntimeContext;
-import org.apache.asterix.common.api.IDatasetLifecycleManager;
-import org.apache.hyracks.api.io.IIOManager;
-import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler;
-import org.apache.hyracks.storage.am.lsm.common.api.ILSMOperationTracker;
-import org.apache.hyracks.storage.common.buffercache.IBufferCache;
-import org.apache.hyracks.storage.common.file.IFileMapProvider;
-import org.apache.hyracks.storage.common.file.ILocalResourceRepository;
-
-public interface IAsterixAppRuntimeContextProvider {
-
- public AsterixThreadExecutor getThreadExecutor();
-
- public IBufferCache getBufferCache();
-
- public IFileMapProvider getFileMapManager();
-
- public ITransactionSubsystem getTransactionSubsystem();
-
- public IDatasetLifecycleManager getDatasetLifecycleManager();
-
- public double getBloomFilterFalsePositiveRate();
-
- public ILSMOperationTracker getLSMBTreeOperationTracker(int datasetID);
-
- public ILSMIOOperationScheduler getLSMIOScheduler();
-
- public ILocalResourceRepository getLocalResourceRepository();
-
- public IIOManager getIOManager();
-
- public IAsterixAppRuntimeContext getAppContext();
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixResourceIdManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixResourceIdManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixResourceIdManager.java
deleted file mode 100644
index 06038cd..0000000
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IAsterixResourceIdManager.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.common.transactions;
-
-public interface IAsterixResourceIdManager {
-
- long createResourceId();
-
- boolean reported(String nodeId);
-
- void report(String nodeId, long maxResourceId);
-
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IResourceIdManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IResourceIdManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IResourceIdManager.java
new file mode 100644
index 0000000..d36d383
--- /dev/null
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/IResourceIdManager.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.common.transactions;
+
+public interface IResourceIdManager {
+
+ long createResourceId();
+
+ boolean reported(String nodeId);
+
+ void report(String nodeId, long maxResourceId);
+
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/ITransactionSubsystem.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/ITransactionSubsystem.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/ITransactionSubsystem.java
index 4ce84b5..dc1e6ed 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/ITransactionSubsystem.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/ITransactionSubsystem.java
@@ -29,7 +29,7 @@ public interface ITransactionSubsystem {
public IRecoveryManager getRecoveryManager();
- public IAsterixAppRuntimeContextProvider getAsterixAppRuntimeContextProvider();
+ public IAppRuntimeContextProvider getAsterixAppRuntimeContextProvider();
public String getId();
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/LogManagerProperties.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/LogManagerProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/LogManagerProperties.java
index c64bd4a..e914db5 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/LogManagerProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/LogManagerProperties.java
@@ -20,7 +20,7 @@ package org.apache.asterix.common.transactions;
import java.io.Serializable;
-import org.apache.asterix.common.config.AsterixTransactionProperties;
+import org.apache.asterix.common.config.TransactionProperties;
public class LogManagerProperties implements Serializable {
@@ -40,7 +40,7 @@ public class LogManagerProperties implements Serializable {
// maximum size of each log file
private final long logPartitionSize;
- public LogManagerProperties(AsterixTransactionProperties txnProperties, String nodeId) {
+ public LogManagerProperties(TransactionProperties txnProperties, String nodeId) {
this.logPageSize = txnProperties.getLogBufferPageSize();
this.numLogPages = txnProperties.getLogBufferNumPages();
long logPartitionSize = txnProperties.getLogPartitionSize();
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/Resource.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/Resource.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/Resource.java
index e781029..0032a70 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/Resource.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/transactions/Resource.java
@@ -59,7 +59,7 @@ public abstract class Resource implements Serializable {
return datasetId;
}
- public abstract ILSMIndex createIndexInstance(IAsterixAppRuntimeContextProvider runtimeContextProvider,
+ public abstract ILSMIndex createIndexInstance(IAppRuntimeContextProvider runtimeContextProvider,
LocalResource resource) throws HyracksDataException;
public static int getIoDeviceNum(IIOManager ioManager, IODeviceHandle deviceHandle) {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/memory/ConcurrentFramePoolUnitTest.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/memory/ConcurrentFramePoolUnitTest.java b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/memory/ConcurrentFramePoolUnitTest.java
index 10c6b24..17e1c5a 100644
--- a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/memory/ConcurrentFramePoolUnitTest.java
+++ b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/memory/ConcurrentFramePoolUnitTest.java
@@ -24,7 +24,7 @@ import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.LinkedBlockingDeque;
-import org.apache.asterix.common.config.AsterixFeedProperties;
+import org.apache.asterix.common.config.FeedProperties;
import org.apache.asterix.common.memory.ConcurrentFramePool;
import org.apache.asterix.common.memory.FrameAction;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -58,7 +58,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testMemoryManager() {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -73,7 +73,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testConcurrentMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -104,7 +104,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testVarSizeMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -139,7 +139,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testConcurrentVarSizeMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -178,7 +178,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testAcquireReleaseMemoryManager() throws HyracksDataException {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -211,7 +211,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testConcurrentAcquireReleaseMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -242,7 +242,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testAcquireReleaseVarSizeMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -295,7 +295,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testConcurrentAcquireReleaseVarSizeMemoryManager() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -331,7 +331,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testFixedSizeSubscribtion() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
@@ -397,7 +397,7 @@ public class ConcurrentFramePoolUnitTest extends TestCase {
@org.junit.Test
public void testgetWhileSubscribersExist() {
try {
- AsterixFeedProperties afp = Mockito.mock(AsterixFeedProperties.class);
+ FeedProperties afp = Mockito.mock(FeedProperties.class);
Mockito.when(afp.getMemoryComponentGlobalBudget()).thenReturn(FEED_MEM_BUDGET);
ConcurrentFramePool fmm = new ConcurrentFramePool("TestNode", afp.getMemoryComponentGlobalBudget(),
DEFAULT_FRAME_SIZE);
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
index 4853129..d03f9df 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
@@ -21,7 +21,7 @@ package org.apache.asterix.external.adapter.factory;
import java.util.List;
import java.util.Map;
-import org.apache.asterix.common.api.IAsterixAppRuntimeContext;
+import org.apache.asterix.common.api.IAppRuntimeContext;
import org.apache.asterix.common.library.ILibraryManager;
import org.apache.asterix.external.api.IAdapterFactory;
import org.apache.asterix.external.api.IDataFlowController;
@@ -86,7 +86,7 @@ public class GenericAdapterFactory implements IIndexingAdapterFactory, IAdapterF
@Override
public synchronized IDataSourceAdapter createAdapter(IHyracksTaskContext ctx, int partition)
throws HyracksDataException {
- IAsterixAppRuntimeContext runtimeCtx = (IAsterixAppRuntimeContext) ctx.getJobletContext()
+ IAppRuntimeContext runtimeCtx = (IAppRuntimeContext) ctx.getJobletContext()
.getApplicationContext().getApplicationObject();
try {
restoreExternalObjects(runtimeCtx.getLibraryManager());
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IExternalDataSourceFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IExternalDataSourceFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IExternalDataSourceFactory.java
index edb79f2..b35d9c6 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IExternalDataSourceFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IExternalDataSourceFactory.java
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.runtime.util.AsterixAppContextInfo;
+import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.asterix.runtime.util.ClusterStateManager;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -87,7 +87,7 @@ public interface IExternalDataSourceFactory extends Serializable {
AlgebricksAbsolutePartitionConstraint constraints, int count) throws AlgebricksException {
if (constraints == null) {
ArrayList<String> locs = new ArrayList<>();
- Set<String> stores = AsterixAppContextInfo.INSTANCE.getMetadataProperties().getStores().keySet();
+ Set<String> stores = AppContextInfo.INSTANCE.getMetadataProperties().getStores().keySet();
if (stores.isEmpty()) {
throw new AlgebricksException("Configurations don't have any stores");
}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/management/FeedEventsListener.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/management/FeedEventsListener.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/management/FeedEventsListener.java
index 02d2c8b..da26e85 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/management/FeedEventsListener.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/management/FeedEventsListener.java
@@ -43,7 +43,7 @@ import org.apache.asterix.external.operators.FeedCollectOperatorDescriptor;
import org.apache.asterix.external.operators.FeedIntakeOperatorDescriptor;
import org.apache.asterix.external.operators.FeedMetaOperatorDescriptor;
import org.apache.asterix.external.util.FeedUtils.JobType;
-import org.apache.asterix.runtime.util.AsterixAppContextInfo;
+import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.runtime.base.IPushRuntimeFactory;
import org.apache.hyracks.algebricks.runtime.operators.meta.AlgebricksMetaOperatorDescriptor;
@@ -202,7 +202,7 @@ public class FeedEventsListener implements IActiveEntityEventsListener {
}
}
- IHyracksClientConnection hcc = AsterixAppContextInfo.INSTANCE.getHcc();
+ IHyracksClientConnection hcc = AppContextInfo.INSTANCE.getHcc();
JobInfo info = hcc.getJobInfo(intakeJobInfo.getJobId());
List<String> intakeLocations = new ArrayList<>();
for (OperatorDescriptorId intakeOperatorId : intakeOperatorIds) {
@@ -349,7 +349,7 @@ public class FeedEventsListener implements IActiveEntityEventsListener {
private synchronized void handleFeedIntakeJobFinishMessage(FeedIntakeInfo intakeInfo, ActiveEvent message)
throws Exception {
- IHyracksClientConnection hcc = AsterixAppContextInfo.INSTANCE.getHcc();
+ IHyracksClientConnection hcc = AppContextInfo.INSTANCE.getHcc();
JobInfo info = hcc.getJobInfo(message.getJobId());
JobStatus status = info.getStatus();
EntityId feedId = intakeInfo.getFeedId();
@@ -369,7 +369,7 @@ public class FeedEventsListener implements IActiveEntityEventsListener {
private synchronized void handleFeedCollectJobFinishMessage(FeedConnectJobInfo cInfo) throws Exception {
FeedConnectionId connectionId = cInfo.getConnectionId();
- IHyracksClientConnection hcc = AsterixAppContextInfo.INSTANCE.getHcc();
+ IHyracksClientConnection hcc = AppContextInfo.INSTANCE.getHcc();
JobInfo info = hcc.getJobInfo(cInfo.getJobId());
JobStatus status = info.getStatus();
boolean failure = status != null && status.equals(JobStatus.FAILURE);
@@ -523,7 +523,7 @@ public class FeedEventsListener implements IActiveEntityEventsListener {
}
try {
- IHyracksClientConnection hcc = AsterixAppContextInfo.INSTANCE.getHcc();
+ IHyracksClientConnection hcc = AppContextInfo.INSTANCE.getHcc();
JobInfo info = hcc.getJobInfo(cInfo.getJobId());
List<String> collectLocations = new ArrayList<>();
for (OperatorDescriptorId collectOpId : collectOperatorIds) {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f76d9c37/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunction.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunction.java
index 0a08e46..baaa731 100755
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunction.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunction.java
@@ -20,7 +20,7 @@ package org.apache.asterix.external.library;
import java.io.IOException;
-import org.apache.asterix.common.api.IAsterixAppRuntimeContext;
+import org.apache.asterix.common.api.IAppRuntimeContext;
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.library.ILibraryManager;
import org.apache.asterix.external.api.IExternalFunction;
@@ -31,7 +31,7 @@ import org.apache.asterix.om.functions.IExternalFunctionInfo;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.EnumDeserializer;
import org.apache.asterix.om.types.hierachy.ATypeHierarchy;
-import org.apache.asterix.runtime.util.AsterixAppContextInfo;
+import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
@@ -71,10 +71,10 @@ public abstract class ExternalFunction implements IExternalFunction {
ILibraryManager libraryManager;
if (context == null) {
// Gets the library manager for compile-time constant folding.
- libraryManager = AsterixAppContextInfo.INSTANCE.getLibraryManager();
+ libraryManager = AppContextInfo.INSTANCE.getLibraryManager();
} else {
// Gets the library manager for real runtime evaluation.
- IAsterixAppRuntimeContext runtimeCtx = (IAsterixAppRuntimeContext) context.getJobletContext()
+ IAppRuntimeContext runtimeCtx = (IAppRuntimeContext) context.getJobletContext()
.getApplicationContext().getApplicationObject();
libraryManager = runtimeCtx.getLibraryManager();
}