asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [05/28] asterixdb git commit: Introduce IStorageComponentProvider
Date Thu, 02 Feb 2017 18:24:14 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/FrameDebugUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/FrameDebugUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/FrameDebugUtils.java
deleted file mode 100644
index aa27c42..0000000
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/FrameDebugUtils.java
+++ /dev/null
@@ -1,298 +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.hyracks.dataflow.common.util;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.apache.hyracks.api.comm.IFrameTupleAccessor;
-import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
-import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
-
-/**
- * A Util class used for inspecting frames
- * for debugging purposes
- */
-public class FrameDebugUtils {
-    private FrameDebugUtils() {
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     * @param prefix
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, String prefix) {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            int tc = fta.getTupleCount();
-            StringBuilder sb = new StringBuilder();
-            sb.append(prefix).append("TC: " + tc).append("\n");
-            for (int i = 0; i < tc; ++i) {
-                prettyPrint(fta, recordDescriptor, i, bbis, dis, sb);
-            }
-            System.err.println(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor) {
-        prettyPrint(fta, recordDescriptor, "");
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param operator
-     */
-    public void prettyPrintTags(IFrameTupleAccessor fta, String operator) {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            int tc = fta.getTupleCount();
-            StringBuilder sb = new StringBuilder();
-            sb.append(operator + ":");
-            sb.append("TC: " + tc).append("\n");
-            for (int i = 0; i < tc; ++i) {
-                prettyPrintTag(fta, i, bbis, dis, sb);
-            }
-            System.err.println(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param tid
-     * @param bbis
-     * @param dis
-     * @param sb
-     */
-    protected void prettyPrintTag(IFrameTupleAccessor fta, int tid, ByteBufferInputStream bbis, DataInputStream dis,
-            StringBuilder sb) {
-        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
-        for (int j = 0; j < fta.getFieldCount(); ++j) {
-            sb.append(" ");
-            if (j > 0) {
-                sb.append("|");
-            }
-            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
-            sb.append("{");
-            sb.append(Byte.toString(fta.getBuffer().array()[fta.getTupleStartOffset(tid) + fta.getFieldSlotsLength()
-                    + fta.getFieldStartOffset(tid, j)]));
-            sb.append("}");
-        }
-        sb.append("\n");
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     * @param tid
-     * @param bbis
-     * @param dis
-     * @param sb
-     */
-    protected void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid,
-            ByteBufferInputStream bbis, DataInputStream dis,
-            StringBuilder sb) {
-        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
-        for (int j = 0; j < fta.getFieldCount(); ++j) {
-            sb.append(" ");
-            if (j > 0) {
-                sb.append("|");
-            }
-            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
-            sb.append("{");
-            bbis.setByteBuffer(fta.getBuffer(), fta.getTupleStartOffset(tid) + fta.getFieldSlotsLength() + fta
-                    .getFieldStartOffset(tid, j));
-            try {
-                sb.append(recordDescriptor.getFields()[j].deserialize(dis));
-            } catch (Exception e) {
-                e.printStackTrace();
-                sb.append("Failed to deserialize field" + j);
-            }
-            sb.append("}");
-        }
-        sb.append("\n");
-    }
-
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     * @param tid
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid) {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            StringBuilder sb = new StringBuilder();
-            prettyPrint(fta, recordDescriptor, tid, bbis, dis, sb);
-            System.err.println(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Debugging method
-     * They are safe as they don't print records. Printing records
-     * using IserializerDeserializer can print incorrect results or throw exceptions.
-     * A better way yet would be to use record pointable.
-     * @param fta
-     * @param recordDescriptor
-     * @param prefix
-     * @param recordFields
-     * @throws IOException
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, String prefix,
-            int[] recordFields) throws IOException {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            int tc = fta.getTupleCount();
-            StringBuilder sb = new StringBuilder();
-            sb.append(prefix).append("TC: " + tc).append("\n");
-            for (int i = 0; i < tc; ++i) {
-                prettyPrint(fta, recordDescriptor, i, bbis, dis, sb, recordFields);
-            }
-            System.err.println(sb.toString());
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     * @param tIdx
-     * @param recordFields
-     * @throws IOException
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tIdx, int[] recordFields)
-            throws IOException {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            StringBuilder sb = new StringBuilder();
-            prettyPrint(fta, recordDescriptor, tIdx, bbis, dis, sb, recordFields);
-            System.err.println(sb.toString());
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param tuple
-     * @param fieldsIdx
-     * @param descIdx
-     * @throws HyracksDataException
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple,
-            int fieldsIdx, int descIdx)
-            throws HyracksDataException {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("[");
-            sb.append("f" + fieldsIdx + ":(" + tuple.getFieldStart(fieldsIdx) + ", "
-                    + (tuple.getFieldLength(fieldsIdx) + tuple.getFieldStart(fieldsIdx)) + ") ");
-            sb.append("{");
-            ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(fieldsIdx));
-            bbis.setByteBuffer(bytebuff, tuple.getFieldStart(fieldsIdx));
-            sb.append(recordDescriptor.getFields()[descIdx].deserialize(dis));
-            sb.append("}");
-            sb.append("\n");
-            System.err.println(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param tuple
-     * @param descF
-     * @throws HyracksDataException
-     */
-    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple,
-            int[] descF) throws HyracksDataException {
-        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
-                DataInputStream dis = new DataInputStream(bbis)) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("[");
-            for (int j = 0; j < descF.length; ++j) {
-                sb.append("f" + j + ":(" + tuple.getFieldStart(j) + ", "
-                        + (tuple.getFieldLength(j) + tuple.getFieldStart(j)) + ") ");
-                sb.append("{");
-                ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(j));
-                bbis.setByteBuffer(bytebuff, tuple.getFieldStart(j));
-                sb.append(recordDescriptor.getFields()[descF[j]].deserialize(dis));
-                sb.append("}");
-            }
-            sb.append("\n");
-            System.err.println(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Debugging method
-     * @param fta
-     * @param recordDescriptor
-     * @param tid
-     * @param bbis
-     * @param dis
-     * @param sb
-     * @param recordFields
-     * @throws IOException
-     */
-    protected void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid,
-            ByteBufferInputStream bbis, DataInputStream dis,
-            StringBuilder sb,
-            int[] recordFields) throws IOException {
-        Arrays.sort(recordFields);
-        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
-        for (int j = 0; j < fta.getFieldCount(); ++j) {
-            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
-            sb.append("{");
-            bbis.setByteBuffer(fta.getBuffer(), fta.getTupleStartOffset(tid) + fta
-                    .getFieldSlotsLength() + fta.getFieldStartOffset(tid, j));
-            if (Arrays.binarySearch(recordFields, j) >= 0) {
-                sb.append("{a record field: only print using pointable:");
-                sb.append("tag->" + dis.readByte() + "}");
-            } else {
-                sb.append(recordDescriptor.getFields()[j].deserialize(dis));
-            }
-            sb.append("}");
-        }
-        sb.append("\n");
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/SerdeUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/SerdeUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/SerdeUtils.java
deleted file mode 100644
index 99c438e..0000000
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/SerdeUtils.java
+++ /dev/null
@@ -1,147 +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.hyracks.dataflow.common.util;
-
-import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
-import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
-import org.apache.hyracks.api.dataflow.value.ITypeTraits;
-import org.apache.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
-import org.apache.hyracks.data.std.primitive.BooleanPointable;
-import org.apache.hyracks.data.std.primitive.DoublePointable;
-import org.apache.hyracks.data.std.primitive.FloatPointable;
-import org.apache.hyracks.data.std.primitive.IntegerPointable;
-import org.apache.hyracks.data.std.primitive.LongPointable;
-import org.apache.hyracks.data.std.primitive.ShortPointable;
-import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
-import org.apache.hyracks.dataflow.common.data.marshalling.BooleanSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.FloatSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.Integer64SerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.ShortSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
-
-@SuppressWarnings("rawtypes")
-public class SerdeUtils {
-    public static class PayloadTypeTraits implements ITypeTraits {
-        private static final long serialVersionUID = 1L;
-        final int payloadSize;
-
-        public PayloadTypeTraits(int payloadSize) {
-            this.payloadSize = payloadSize;
-        }
-
-        @Override
-        public boolean isFixedLength() {
-            return true;
-        }
-
-        @Override
-        public int getFixedLength() {
-            return payloadSize;
-        }
-    }
-
-    public static ITypeTraits[] serdesToTypeTraits(ISerializerDeserializer[] serdes) {
-        ITypeTraits[] typeTraits = new ITypeTraits[serdes.length];
-        for (int i = 0; i < serdes.length; i++) {
-            typeTraits[i] = serdeToTypeTrait(serdes[i]);
-        }
-        return typeTraits;
-    }
-
-    public static ITypeTraits[] serdesToTypeTraits(ISerializerDeserializer[] serdes, int payloadSize) {
-        ITypeTraits[] typeTraits = new ITypeTraits[serdes.length + 1];
-        for (int i = 0; i < serdes.length; i++) {
-            typeTraits[i] = serdeToTypeTrait(serdes[i]);
-        }
-        typeTraits[serdes.length] = new PayloadTypeTraits(payloadSize);
-        return typeTraits;
-    }
-
-    public static ITypeTraits serdeToTypeTrait(ISerializerDeserializer serde) {
-        if (serde instanceof ShortSerializerDeserializer) {
-            return ShortPointable.TYPE_TRAITS;
-        }
-        if (serde instanceof IntegerSerializerDeserializer) {
-            return IntegerPointable.TYPE_TRAITS;
-        }
-        if (serde instanceof Integer64SerializerDeserializer) {
-            return LongPointable.TYPE_TRAITS;
-        }
-        if (serde instanceof FloatSerializerDeserializer) {
-            return FloatPointable.TYPE_TRAITS;
-        }
-        if (serde instanceof DoubleSerializerDeserializer) {
-            return DoublePointable.TYPE_TRAITS;
-        }
-        if (serde instanceof BooleanSerializerDeserializer) {
-            return BooleanPointable.TYPE_TRAITS;
-        }
-        return UTF8StringPointable.TYPE_TRAITS;
-    }
-
-    public static IBinaryComparator[] serdesToComparators(ISerializerDeserializer[] serdes, int numSerdes) {
-        IBinaryComparator[] comparators = new IBinaryComparator[numSerdes];
-        for (int i = 0; i < numSerdes; i++) {
-            comparators[i] = serdeToComparator(serdes[i]);
-        }
-        return comparators;
-    }
-
-    public static IBinaryComparator serdeToComparator(ISerializerDeserializer serde) {
-        IBinaryComparatorFactory f = serdeToComparatorFactory(serde);
-        return f.createBinaryComparator();
-    }
-
-    public static IBinaryComparatorFactory[] serdesToComparatorFactories(ISerializerDeserializer[] serdes, int numSerdes) {
-        IBinaryComparatorFactory[] comparatorsFactories = new IBinaryComparatorFactory[numSerdes];
-        for (int i = 0; i < numSerdes; i++) {
-            comparatorsFactories[i] = serdeToComparatorFactory(serdes[i]);
-        }
-        return comparatorsFactories;
-    }
-
-    public static IBinaryComparatorFactory serdeToComparatorFactory(ISerializerDeserializer serde) {
-        if (serde instanceof ShortSerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(ShortPointable.FACTORY);
-        }
-        if (serde instanceof IntegerSerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(IntegerPointable.FACTORY);
-        }
-        if (serde instanceof Integer64SerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(LongPointable.FACTORY);
-        }
-        if (serde instanceof FloatSerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(FloatPointable.FACTORY);
-        }
-        if (serde instanceof DoubleSerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(DoublePointable.FACTORY);
-        }
-        if (serde instanceof BooleanSerializerDeserializer) {
-            throw new UnsupportedOperationException("Binary comparator factory for Boolean not implemented.");
-        }
-        if (serde instanceof UTF8StringSerializerDeserializer) {
-            return PointableBinaryComparatorFactory.of(UTF8StringPointable.FACTORY);
-        }
-        throw new UnsupportedOperationException("Binary comparator for + " + serde.toString() + " not implemented.");
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TaskUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TaskUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TaskUtils.java
deleted file mode 100644
index 4f27d79..0000000
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TaskUtils.java
+++ /dev/null
@@ -1,77 +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.hyracks.dataflow.common.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-
-/**
- * A Utility class for facilitating common operations used with a hyracks task
- */
-public class TaskUtils {
-    private TaskUtils() {
-    }
-
-    /**
-     * get the shared object of a task as a Map<String,Object>
-     *
-     * @param ctx
-     *            the task context
-     * @param create
-     * @return the task shared map
-     */
-    @SuppressWarnings("unchecked")
-    public static Map<String, Object> getSharedMap(IHyracksTaskContext ctx, boolean create) {
-        if (ctx.getSharedObject() != null) {
-            return (Map<String, Object>) ctx.getSharedObject();
-        } else if (create) {
-            Map<String, Object> taskMap = new HashMap<>();
-            ctx.setSharedObject(taskMap);
-            return taskMap;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * put the key value pair in a map task object
-     *
-     * @param key
-     * @param ctx
-     * @param object
-     */
-    public static void putInSharedMap(String key, Object object, IHyracksTaskContext ctx) {
-        TaskUtils.getSharedMap(ctx, true).put(key, object);
-    }
-
-    /**
-     * get a <T> object from the shared map of the task
-     *
-     * @param key
-     * @param ctx
-     * @return the value associated with the key casted as T
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T get(String key, IHyracksTaskContext ctx) {
-        Map<String, Object> sharedMap = TaskUtils.getSharedMap(ctx, false);
-        return sharedMap == null ? null : (T) sharedMap.get(key);
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TupleUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TupleUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TupleUtils.java
deleted file mode 100644
index fcc6274..0000000
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/util/TupleUtils.java
+++ /dev/null
@@ -1,140 +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.hyracks.dataflow.common.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-
-import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference;
-import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
-import org.apache.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
-import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
-
-@SuppressWarnings("rawtypes")
-public class TupleUtils {
-    @SuppressWarnings("unchecked")
-    public static void createTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
-            ISerializerDeserializer[] fieldSerdes, final Object... fields) throws HyracksDataException {
-        DataOutput dos = tupleBuilder.getDataOutput();
-        tupleBuilder.reset();
-        int numFields = Math.min(tupleBuilder.getFieldEndOffsets().length, fields.length);
-        for (int i = 0; i < numFields; i++) {
-            fieldSerdes[i].serialize(fields[i], dos);
-            tupleBuilder.addFieldEndOffset();
-        }
-        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
-    }
-
-    public static ITupleReference createTuple(ISerializerDeserializer[] fieldSerdes, final Object... fields)
-            throws HyracksDataException {
-        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
-        ArrayTupleReference tuple = new ArrayTupleReference();
-        createTuple(tupleBuilder, tuple, fieldSerdes, fields);
-        return tuple;
-    }
-
-    public static void createIntegerTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
-            final int... fields) throws HyracksDataException {
-        DataOutput dos = tupleBuilder.getDataOutput();
-        tupleBuilder.reset();
-        for (final int i : fields) {
-            IntegerSerializerDeserializer.INSTANCE.serialize(i, dos);
-            tupleBuilder.addFieldEndOffset();
-        }
-        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
-    }
-
-    public static ITupleReference createIntegerTuple(final int... fields) throws HyracksDataException {
-        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
-        ArrayTupleReference tuple = new ArrayTupleReference();
-        createIntegerTuple(tupleBuilder, tuple, fields);
-        return tuple;
-    }
-
-    public static void createDoubleTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
-            final double... fields) throws HyracksDataException {
-        DataOutput dos = tupleBuilder.getDataOutput();
-        tupleBuilder.reset();
-        for (final double i : fields) {
-            DoubleSerializerDeserializer.INSTANCE.serialize(i, dos);
-            tupleBuilder.addFieldEndOffset();
-        }
-        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
-    }
-
-    public static ITupleReference createDoubleTuple(final double... fields) throws HyracksDataException {
-        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
-        ArrayTupleReference tuple = new ArrayTupleReference();
-        createDoubleTuple(tupleBuilder, tuple, fields);
-        return tuple;
-    }
-
-    public static String printTuple(ITupleReference tuple, ISerializerDeserializer[] fields)
-            throws HyracksDataException {
-        StringBuilder strBuilder = new StringBuilder();
-        int numPrintFields = Math.min(tuple.getFieldCount(), fields.length);
-        for (int i = 0; i < numPrintFields; i++) {
-            ByteArrayInputStream inStream = new ByteArrayInputStream(tuple.getFieldData(i), tuple.getFieldStart(i),
-                    tuple.getFieldLength(i));
-            DataInput dataIn = new DataInputStream(inStream);
-            Object o = fields[i].deserialize(dataIn);
-            strBuilder.append(o.toString());
-            if (i != fields.length - 1) {
-                strBuilder.append(" ");
-            }
-        }
-        return strBuilder.toString();
-    }
-
-    public static Object[] deserializeTuple(ITupleReference tuple, ISerializerDeserializer[] fields)
-            throws HyracksDataException {
-        int numFields = Math.min(tuple.getFieldCount(), fields.length);
-        Object[] objs = new Object[numFields];
-        for (int i = 0; i < numFields; i++) {
-            ByteArrayInputStream inStream = new ByteArrayInputStream(tuple.getFieldData(i), tuple.getFieldStart(i),
-                    tuple.getFieldLength(i));
-            DataInput dataIn = new DataInputStream(inStream);
-            objs[i] = fields[i].deserialize(dataIn);
-        }
-        return objs;
-    }
-
-    public static ITupleReference copyTuple(ITupleReference tuple) throws HyracksDataException {
-        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(tuple.getFieldCount());
-        for (int i = 0; i < tuple.getFieldCount(); i++) {
-            tupleBuilder.addField(tuple.getFieldData(i), tuple.getFieldStart(i), tuple.getFieldLength(i));
-        }
-        ArrayTupleReference tupleCopy = new ArrayTupleReference();
-        tupleCopy.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
-        return tupleCopy;
-    }
-
-    public static void copyTuple(ArrayTupleBuilder tupleBuilder, ITupleReference tuple, int numFields) throws HyracksDataException {
-        tupleBuilder.reset();
-        for (int i = 0; i < numFields; i++) {
-            tupleBuilder.addField(tuple.getFieldData(i), tuple.getFieldStart(i), tuple.getFieldLength(i));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/FrameDebugUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/FrameDebugUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/FrameDebugUtils.java
new file mode 100644
index 0000000..66e7ae0
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/FrameDebugUtils.java
@@ -0,0 +1,298 @@
+/*
+ * 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.hyracks.dataflow.common.utils;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+import org.apache.hyracks.api.comm.IFrameTupleAccessor;
+import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+
+/**
+ * A Util class used for inspecting frames
+ * for debugging purposes
+ */
+public class FrameDebugUtils {
+    private FrameDebugUtils() {
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     * @param prefix
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, String prefix) {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            int tc = fta.getTupleCount();
+            StringBuilder sb = new StringBuilder();
+            sb.append(prefix).append("TC: " + tc).append("\n");
+            for (int i = 0; i < tc; ++i) {
+                prettyPrint(fta, recordDescriptor, i, bbis, dis, sb);
+            }
+            System.err.println(sb.toString());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor) {
+        prettyPrint(fta, recordDescriptor, "");
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param operator
+     */
+    public void prettyPrintTags(IFrameTupleAccessor fta, String operator) {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            int tc = fta.getTupleCount();
+            StringBuilder sb = new StringBuilder();
+            sb.append(operator + ":");
+            sb.append("TC: " + tc).append("\n");
+            for (int i = 0; i < tc; ++i) {
+                prettyPrintTag(fta, i, bbis, dis, sb);
+            }
+            System.err.println(sb.toString());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param tid
+     * @param bbis
+     * @param dis
+     * @param sb
+     */
+    protected void prettyPrintTag(IFrameTupleAccessor fta, int tid, ByteBufferInputStream bbis, DataInputStream dis,
+            StringBuilder sb) {
+        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
+        for (int j = 0; j < fta.getFieldCount(); ++j) {
+            sb.append(" ");
+            if (j > 0) {
+                sb.append("|");
+            }
+            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
+            sb.append("{");
+            sb.append(Byte.toString(fta.getBuffer().array()[fta.getTupleStartOffset(tid) + fta.getFieldSlotsLength()
+                    + fta.getFieldStartOffset(tid, j)]));
+            sb.append("}");
+        }
+        sb.append("\n");
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     * @param tid
+     * @param bbis
+     * @param dis
+     * @param sb
+     */
+    protected void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid,
+            ByteBufferInputStream bbis, DataInputStream dis,
+            StringBuilder sb) {
+        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
+        for (int j = 0; j < fta.getFieldCount(); ++j) {
+            sb.append(" ");
+            if (j > 0) {
+                sb.append("|");
+            }
+            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
+            sb.append("{");
+            bbis.setByteBuffer(fta.getBuffer(), fta.getTupleStartOffset(tid) + fta.getFieldSlotsLength() + fta
+                    .getFieldStartOffset(tid, j));
+            try {
+                sb.append(recordDescriptor.getFields()[j].deserialize(dis));
+            } catch (Exception e) {
+                e.printStackTrace();
+                sb.append("Failed to deserialize field" + j);
+            }
+            sb.append("}");
+        }
+        sb.append("\n");
+    }
+
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     * @param tid
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid) {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            StringBuilder sb = new StringBuilder();
+            prettyPrint(fta, recordDescriptor, tid, bbis, dis, sb);
+            System.err.println(sb.toString());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Debugging method
+     * They are safe as they don't print records. Printing records
+     * using IserializerDeserializer can print incorrect results or throw exceptions.
+     * A better way yet would be to use record pointable.
+     * @param fta
+     * @param recordDescriptor
+     * @param prefix
+     * @param recordFields
+     * @throws IOException
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, String prefix,
+            int[] recordFields) throws IOException {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            int tc = fta.getTupleCount();
+            StringBuilder sb = new StringBuilder();
+            sb.append(prefix).append("TC: " + tc).append("\n");
+            for (int i = 0; i < tc; ++i) {
+                prettyPrint(fta, recordDescriptor, i, bbis, dis, sb, recordFields);
+            }
+            System.err.println(sb.toString());
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     * @param tIdx
+     * @param recordFields
+     * @throws IOException
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tIdx, int[] recordFields)
+            throws IOException {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            StringBuilder sb = new StringBuilder();
+            prettyPrint(fta, recordDescriptor, tIdx, bbis, dis, sb, recordFields);
+            System.err.println(sb.toString());
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param tuple
+     * @param fieldsIdx
+     * @param descIdx
+     * @throws HyracksDataException
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple,
+            int fieldsIdx, int descIdx)
+            throws HyracksDataException {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            StringBuilder sb = new StringBuilder();
+            sb.append("[");
+            sb.append("f" + fieldsIdx + ":(" + tuple.getFieldStart(fieldsIdx) + ", "
+                    + (tuple.getFieldLength(fieldsIdx) + tuple.getFieldStart(fieldsIdx)) + ") ");
+            sb.append("{");
+            ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(fieldsIdx));
+            bbis.setByteBuffer(bytebuff, tuple.getFieldStart(fieldsIdx));
+            sb.append(recordDescriptor.getFields()[descIdx].deserialize(dis));
+            sb.append("}");
+            sb.append("\n");
+            System.err.println(sb.toString());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param tuple
+     * @param descF
+     * @throws HyracksDataException
+     */
+    public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple,
+            int[] descF) throws HyracksDataException {
+        try (ByteBufferInputStream bbis = new ByteBufferInputStream();
+                DataInputStream dis = new DataInputStream(bbis)) {
+            StringBuilder sb = new StringBuilder();
+            sb.append("[");
+            for (int j = 0; j < descF.length; ++j) {
+                sb.append("f" + j + ":(" + tuple.getFieldStart(j) + ", "
+                        + (tuple.getFieldLength(j) + tuple.getFieldStart(j)) + ") ");
+                sb.append("{");
+                ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(j));
+                bbis.setByteBuffer(bytebuff, tuple.getFieldStart(j));
+                sb.append(recordDescriptor.getFields()[descF[j]].deserialize(dis));
+                sb.append("}");
+            }
+            sb.append("\n");
+            System.err.println(sb.toString());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Debugging method
+     * @param fta
+     * @param recordDescriptor
+     * @param tid
+     * @param bbis
+     * @param dis
+     * @param sb
+     * @param recordFields
+     * @throws IOException
+     */
+    protected void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid,
+            ByteBufferInputStream bbis, DataInputStream dis,
+            StringBuilder sb,
+            int[] recordFields) throws IOException {
+        Arrays.sort(recordFields);
+        sb.append(" tid" + tid + ":(" + fta.getTupleStartOffset(tid) + ", " + fta.getTupleEndOffset(tid) + ")[");
+        for (int j = 0; j < fta.getFieldCount(); ++j) {
+            sb.append("f" + j + ":(" + fta.getFieldStartOffset(tid, j) + ", " + fta.getFieldEndOffset(tid, j) + ") ");
+            sb.append("{");
+            bbis.setByteBuffer(fta.getBuffer(), fta.getTupleStartOffset(tid) + fta
+                    .getFieldSlotsLength() + fta.getFieldStartOffset(tid, j));
+            if (Arrays.binarySearch(recordFields, j) >= 0) {
+                sb.append("{a record field: only print using pointable:");
+                sb.append("tag->" + dis.readByte() + "}");
+            } else {
+                sb.append(recordDescriptor.getFields()[j].deserialize(dis));
+            }
+            sb.append("}");
+        }
+        sb.append("\n");
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/SerdeUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/SerdeUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/SerdeUtils.java
new file mode 100644
index 0000000..81f06da
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/SerdeUtils.java
@@ -0,0 +1,147 @@
+/*
+ * 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.hyracks.dataflow.common.utils;
+
+import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
+import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
+import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
+import org.apache.hyracks.data.std.primitive.BooleanPointable;
+import org.apache.hyracks.data.std.primitive.DoublePointable;
+import org.apache.hyracks.data.std.primitive.FloatPointable;
+import org.apache.hyracks.data.std.primitive.IntegerPointable;
+import org.apache.hyracks.data.std.primitive.LongPointable;
+import org.apache.hyracks.data.std.primitive.ShortPointable;
+import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
+import org.apache.hyracks.dataflow.common.data.marshalling.BooleanSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.FloatSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.Integer64SerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.ShortSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
+
+@SuppressWarnings("rawtypes")
+public class SerdeUtils {
+    public static class PayloadTypeTraits implements ITypeTraits {
+        private static final long serialVersionUID = 1L;
+        final int payloadSize;
+
+        public PayloadTypeTraits(int payloadSize) {
+            this.payloadSize = payloadSize;
+        }
+
+        @Override
+        public boolean isFixedLength() {
+            return true;
+        }
+
+        @Override
+        public int getFixedLength() {
+            return payloadSize;
+        }
+    }
+
+    public static ITypeTraits[] serdesToTypeTraits(ISerializerDeserializer[] serdes) {
+        ITypeTraits[] typeTraits = new ITypeTraits[serdes.length];
+        for (int i = 0; i < serdes.length; i++) {
+            typeTraits[i] = serdeToTypeTrait(serdes[i]);
+        }
+        return typeTraits;
+    }
+
+    public static ITypeTraits[] serdesToTypeTraits(ISerializerDeserializer[] serdes, int payloadSize) {
+        ITypeTraits[] typeTraits = new ITypeTraits[serdes.length + 1];
+        for (int i = 0; i < serdes.length; i++) {
+            typeTraits[i] = serdeToTypeTrait(serdes[i]);
+        }
+        typeTraits[serdes.length] = new PayloadTypeTraits(payloadSize);
+        return typeTraits;
+    }
+
+    public static ITypeTraits serdeToTypeTrait(ISerializerDeserializer serde) {
+        if (serde instanceof ShortSerializerDeserializer) {
+            return ShortPointable.TYPE_TRAITS;
+        }
+        if (serde instanceof IntegerSerializerDeserializer) {
+            return IntegerPointable.TYPE_TRAITS;
+        }
+        if (serde instanceof Integer64SerializerDeserializer) {
+            return LongPointable.TYPE_TRAITS;
+        }
+        if (serde instanceof FloatSerializerDeserializer) {
+            return FloatPointable.TYPE_TRAITS;
+        }
+        if (serde instanceof DoubleSerializerDeserializer) {
+            return DoublePointable.TYPE_TRAITS;
+        }
+        if (serde instanceof BooleanSerializerDeserializer) {
+            return BooleanPointable.TYPE_TRAITS;
+        }
+        return UTF8StringPointable.TYPE_TRAITS;
+    }
+
+    public static IBinaryComparator[] serdesToComparators(ISerializerDeserializer[] serdes, int numSerdes) {
+        IBinaryComparator[] comparators = new IBinaryComparator[numSerdes];
+        for (int i = 0; i < numSerdes; i++) {
+            comparators[i] = serdeToComparator(serdes[i]);
+        }
+        return comparators;
+    }
+
+    public static IBinaryComparator serdeToComparator(ISerializerDeserializer serde) {
+        IBinaryComparatorFactory f = serdeToComparatorFactory(serde);
+        return f.createBinaryComparator();
+    }
+
+    public static IBinaryComparatorFactory[] serdesToComparatorFactories(ISerializerDeserializer[] serdes, int numSerdes) {
+        IBinaryComparatorFactory[] comparatorsFactories = new IBinaryComparatorFactory[numSerdes];
+        for (int i = 0; i < numSerdes; i++) {
+            comparatorsFactories[i] = serdeToComparatorFactory(serdes[i]);
+        }
+        return comparatorsFactories;
+    }
+
+    public static IBinaryComparatorFactory serdeToComparatorFactory(ISerializerDeserializer serde) {
+        if (serde instanceof ShortSerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(ShortPointable.FACTORY);
+        }
+        if (serde instanceof IntegerSerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(IntegerPointable.FACTORY);
+        }
+        if (serde instanceof Integer64SerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(LongPointable.FACTORY);
+        }
+        if (serde instanceof FloatSerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(FloatPointable.FACTORY);
+        }
+        if (serde instanceof DoubleSerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(DoublePointable.FACTORY);
+        }
+        if (serde instanceof BooleanSerializerDeserializer) {
+            throw new UnsupportedOperationException("Binary comparator factory for Boolean not implemented.");
+        }
+        if (serde instanceof UTF8StringSerializerDeserializer) {
+            return PointableBinaryComparatorFactory.of(UTF8StringPointable.FACTORY);
+        }
+        throw new UnsupportedOperationException("Binary comparator for + " + serde.toString() + " not implemented.");
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TaskUtil.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TaskUtil.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TaskUtil.java
new file mode 100644
index 0000000..4a2021f
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TaskUtil.java
@@ -0,0 +1,77 @@
+/*
+ * 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.hyracks.dataflow.common.utils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+
+/**
+ * A Utility class for facilitating common operations used with a hyracks task
+ */
+public class TaskUtil {
+    private TaskUtil() {
+    }
+
+    /**
+     * get the shared object of a task as a Map<String,Object>
+     *
+     * @param ctx
+     *            the task context
+     * @param create
+     * @return the task shared map
+     */
+    @SuppressWarnings("unchecked")
+    public static Map<String, Object> getSharedMap(IHyracksTaskContext ctx, boolean create) {
+        if (ctx.getSharedObject() != null) {
+            return (Map<String, Object>) ctx.getSharedObject();
+        } else if (create) {
+            Map<String, Object> taskMap = new HashMap<>();
+            ctx.setSharedObject(taskMap);
+            return taskMap;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * put the key value pair in a map task object
+     *
+     * @param key
+     * @param ctx
+     * @param object
+     */
+    public static void putInSharedMap(String key, Object object, IHyracksTaskContext ctx) {
+        TaskUtil.getSharedMap(ctx, true).put(key, object);
+    }
+
+    /**
+     * get a <T> object from the shared map of the task
+     *
+     * @param key
+     * @param ctx
+     * @return the value associated with the key casted as T
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T get(String key, IHyracksTaskContext ctx) {
+        Map<String, Object> sharedMap = TaskUtil.getSharedMap(ctx, false);
+        return sharedMap == null ? null : (T) sharedMap.get(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TupleUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TupleUtils.java b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TupleUtils.java
new file mode 100644
index 0000000..500cee7
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-common/src/main/java/org/apache/hyracks/dataflow/common/utils/TupleUtils.java
@@ -0,0 +1,140 @@
+/*
+ * 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.hyracks.dataflow.common.utils;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+
+import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
+import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
+
+@SuppressWarnings("rawtypes")
+public class TupleUtils {
+    @SuppressWarnings("unchecked")
+    public static void createTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
+            ISerializerDeserializer[] fieldSerdes, final Object... fields) throws HyracksDataException {
+        DataOutput dos = tupleBuilder.getDataOutput();
+        tupleBuilder.reset();
+        int numFields = Math.min(tupleBuilder.getFieldEndOffsets().length, fields.length);
+        for (int i = 0; i < numFields; i++) {
+            fieldSerdes[i].serialize(fields[i], dos);
+            tupleBuilder.addFieldEndOffset();
+        }
+        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+    }
+
+    public static ITupleReference createTuple(ISerializerDeserializer[] fieldSerdes, final Object... fields)
+            throws HyracksDataException {
+        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
+        ArrayTupleReference tuple = new ArrayTupleReference();
+        createTuple(tupleBuilder, tuple, fieldSerdes, fields);
+        return tuple;
+    }
+
+    public static void createIntegerTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
+            final int... fields) throws HyracksDataException {
+        DataOutput dos = tupleBuilder.getDataOutput();
+        tupleBuilder.reset();
+        for (final int i : fields) {
+            IntegerSerializerDeserializer.INSTANCE.serialize(i, dos);
+            tupleBuilder.addFieldEndOffset();
+        }
+        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+    }
+
+    public static ITupleReference createIntegerTuple(final int... fields) throws HyracksDataException {
+        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
+        ArrayTupleReference tuple = new ArrayTupleReference();
+        createIntegerTuple(tupleBuilder, tuple, fields);
+        return tuple;
+    }
+
+    public static void createDoubleTuple(ArrayTupleBuilder tupleBuilder, ArrayTupleReference tuple,
+            final double... fields) throws HyracksDataException {
+        DataOutput dos = tupleBuilder.getDataOutput();
+        tupleBuilder.reset();
+        for (final double i : fields) {
+            DoubleSerializerDeserializer.INSTANCE.serialize(i, dos);
+            tupleBuilder.addFieldEndOffset();
+        }
+        tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+    }
+
+    public static ITupleReference createDoubleTuple(final double... fields) throws HyracksDataException {
+        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(fields.length);
+        ArrayTupleReference tuple = new ArrayTupleReference();
+        createDoubleTuple(tupleBuilder, tuple, fields);
+        return tuple;
+    }
+
+    public static String printTuple(ITupleReference tuple, ISerializerDeserializer[] fields)
+            throws HyracksDataException {
+        StringBuilder strBuilder = new StringBuilder();
+        int numPrintFields = Math.min(tuple.getFieldCount(), fields.length);
+        for (int i = 0; i < numPrintFields; i++) {
+            ByteArrayInputStream inStream = new ByteArrayInputStream(tuple.getFieldData(i), tuple.getFieldStart(i),
+                    tuple.getFieldLength(i));
+            DataInput dataIn = new DataInputStream(inStream);
+            Object o = fields[i].deserialize(dataIn);
+            strBuilder.append(o.toString());
+            if (i != fields.length - 1) {
+                strBuilder.append(" ");
+            }
+        }
+        return strBuilder.toString();
+    }
+
+    public static Object[] deserializeTuple(ITupleReference tuple, ISerializerDeserializer[] fields)
+            throws HyracksDataException {
+        int numFields = Math.min(tuple.getFieldCount(), fields.length);
+        Object[] objs = new Object[numFields];
+        for (int i = 0; i < numFields; i++) {
+            ByteArrayInputStream inStream = new ByteArrayInputStream(tuple.getFieldData(i), tuple.getFieldStart(i),
+                    tuple.getFieldLength(i));
+            DataInput dataIn = new DataInputStream(inStream);
+            objs[i] = fields[i].deserialize(dataIn);
+        }
+        return objs;
+    }
+
+    public static ITupleReference copyTuple(ITupleReference tuple) throws HyracksDataException {
+        ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(tuple.getFieldCount());
+        for (int i = 0; i < tuple.getFieldCount(); i++) {
+            tupleBuilder.addField(tuple.getFieldData(i), tuple.getFieldStart(i), tuple.getFieldLength(i));
+        }
+        ArrayTupleReference tupleCopy = new ArrayTupleReference();
+        tupleCopy.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
+        return tupleCopy;
+    }
+
+    public static void copyTuple(ArrayTupleBuilder tupleBuilder, ITupleReference tuple, int numFields) throws HyracksDataException {
+        tupleBuilder.reset();
+        for (int i = 0; i < numFields; i++) {
+            tupleBuilder.addField(tuple.getFieldData(i), tuple.getFieldStart(i), tuple.getFieldLength(i));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
index 91aa263..0772d83 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
@@ -43,7 +43,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
 import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.DataGenOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.IndexLifecycleManagerProvider;
-import org.apache.hyracks.examples.btree.helper.StorageManagerInterface;
+import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
@@ -51,7 +51,7 @@ import org.apache.hyracks.storage.am.common.dataflow.TreeIndexInsertUpdateDelete
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
 import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
@@ -128,7 +128,7 @@ public class InsertPipelineExample {
         PartitionConstraintHelper.addAbsoluteLocationConstraint(spec, dataGen, splitNCs[0]);
 
         IIndexLifecycleManagerProvider lcManagerProvider = IndexLifecycleManagerProvider.INSTANCE;
-        IStorageManagerInterface storageManager = StorageManagerInterface.INSTANCE;
+        IStorageManager storageManager = BTreeHelperStorageManager.INSTANCE;
 
         // prepare insertion into primary index
         // tuples to be put into B-Tree shall have 4 fields

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
index b8216e3..550af4c 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
@@ -43,13 +43,13 @@ import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
 import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.DataGenOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.IndexLifecycleManagerProvider;
-import org.apache.hyracks.examples.btree.helper.StorageManagerInterface;
+import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.dataflow.TreeIndexBulkLoadOperatorDescriptor;
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
@@ -145,7 +145,7 @@ public class PrimaryIndexBulkLoadExample {
 
         // create providers for B-Tree
         IIndexLifecycleManagerProvider lcManagerProvider = IndexLifecycleManagerProvider.INSTANCE;
-        IStorageManagerInterface storageManager = StorageManagerInterface.INSTANCE;
+        IStorageManager storageManager = BTreeHelperStorageManager.INSTANCE;
 
         // the B-Tree expects its keyfields to be at the front of its input
         // tuple

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
index 2d1d515..f15648e 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
@@ -40,14 +40,14 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
 import org.apache.hyracks.dataflow.std.misc.ConstantTupleSourceOperatorDescriptor;
 import org.apache.hyracks.dataflow.std.misc.PrinterOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.IndexLifecycleManagerProvider;
-import org.apache.hyracks.examples.btree.helper.StorageManagerInterface;
+import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
 import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
@@ -107,7 +107,7 @@ public class PrimaryIndexSearchExample {
 
         // create roviders for B-Tree
         IIndexLifecycleManagerProvider lcManagerProvider = IndexLifecycleManagerProvider.INSTANCE;
-        IStorageManagerInterface storageManager = StorageManagerInterface.INSTANCE;
+        IStorageManager storageManager = BTreeHelperStorageManager.INSTANCE;
 
         // schema of tuples coming out of primary index
         RecordDescriptor recDesc = new RecordDescriptor(new ISerializerDeserializer[] {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
index c1ccc10..003e353 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
@@ -36,7 +36,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
 import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
 import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.IndexLifecycleManagerProvider;
-import org.apache.hyracks.examples.btree.helper.StorageManagerInterface;
+import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
@@ -44,7 +44,7 @@ import org.apache.hyracks.storage.am.common.dataflow.TreeIndexBulkLoadOperatorDe
 import org.apache.hyracks.storage.am.common.dataflow.TreeIndexDiskOrderScanOperatorDescriptor;
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
@@ -98,7 +98,7 @@ public class SecondaryIndexBulkLoadExample {
         String[] splitNCs = options.ncs.split(",");
 
         IIndexLifecycleManagerProvider lcManagerProvider = IndexLifecycleManagerProvider.INSTANCE;
-        IStorageManagerInterface storageManager = StorageManagerInterface.INSTANCE;
+        IStorageManager storageManager = BTreeHelperStorageManager.INSTANCE;
 
         // schema of tuples that we are retrieving from the primary index
         RecordDescriptor recDesc = new RecordDescriptor(new ISerializerDeserializer[] {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
index a4b366a..94152d1 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
@@ -40,14 +40,14 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
 import org.apache.hyracks.dataflow.std.misc.ConstantTupleSourceOperatorDescriptor;
 import org.apache.hyracks.dataflow.std.misc.PrinterOperatorDescriptor;
 import org.apache.hyracks.examples.btree.helper.IndexLifecycleManagerProvider;
-import org.apache.hyracks.examples.btree.helper.StorageManagerInterface;
+import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
 import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
@@ -98,7 +98,7 @@ public class SecondaryIndexSearchExample {
         String[] splitNCs = options.ncs.split(",");
 
         IIndexLifecycleManagerProvider lcManagerProvider = IndexLifecycleManagerProvider.INSTANCE;
-        IStorageManagerInterface storageManager = StorageManagerInterface.INSTANCE;
+        IStorageManager storageManager = BTreeHelperStorageManager.INSTANCE;
 
         // schema of tuples coming out of secondary index
         RecordDescriptor secondaryRecDesc = new RecordDescriptor(new ISerializerDeserializer[] {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/BTreeHelperStorageManager.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/BTreeHelperStorageManager.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/BTreeHelperStorageManager.java
new file mode 100644
index 0000000..8f05266
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/BTreeHelperStorageManager.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.hyracks.examples.btree.helper;
+
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.storage.common.IStorageManager;
+import org.apache.hyracks.storage.common.buffercache.IBufferCache;
+import org.apache.hyracks.storage.common.file.IFileMapProvider;
+import org.apache.hyracks.storage.common.file.ILocalResourceRepository;
+import org.apache.hyracks.storage.common.file.ResourceIdFactory;
+
+public class BTreeHelperStorageManager implements IStorageManager {
+    private static final long serialVersionUID = 1L;
+
+    public static final BTreeHelperStorageManager INSTANCE = new BTreeHelperStorageManager();
+
+    private BTreeHelperStorageManager() {
+    }
+
+    @Override
+    public IBufferCache getBufferCache(IHyracksTaskContext ctx) {
+        return RuntimeContext.get(ctx).getBufferCache();
+    }
+
+    @Override
+    public IFileMapProvider getFileMapProvider(IHyracksTaskContext ctx) {
+        return RuntimeContext.get(ctx).getFileMapManager();
+    }
+
+    @Override
+    public ILocalResourceRepository getLocalResourceRepository(IHyracksTaskContext ctx) {
+        return RuntimeContext.get(ctx).getLocalResourceRepository();
+    }
+
+    @Override
+    public ResourceIdFactory getResourceIdFactory(IHyracksTaskContext ctx) {
+        return RuntimeContext.get(ctx).getResourceIdFactory();
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/StorageManagerInterface.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/StorageManagerInterface.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/StorageManagerInterface.java
deleted file mode 100644
index 7996bb0..0000000
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/StorageManagerInterface.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.hyracks.examples.btree.helper;
-
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
-import org.apache.hyracks.storage.common.buffercache.IBufferCache;
-import org.apache.hyracks.storage.common.file.IFileMapProvider;
-import org.apache.hyracks.storage.common.file.ILocalResourceRepository;
-import org.apache.hyracks.storage.common.file.ResourceIdFactory;
-
-public class StorageManagerInterface implements IStorageManagerInterface {
-    private static final long serialVersionUID = 1L;
-
-    public static final StorageManagerInterface INSTANCE = new StorageManagerInterface();
-
-    private StorageManagerInterface() {
-    }
-
-    @Override
-    public IBufferCache getBufferCache(IHyracksTaskContext ctx) {
-        return RuntimeContext.get(ctx).getBufferCache();
-    }
-
-    @Override
-    public IFileMapProvider getFileMapProvider(IHyracksTaskContext ctx) {
-        return RuntimeContext.get(ctx).getFileMapManager();
-    }
-
-    @Override
-    public ILocalResourceRepository getLocalResourceRepository(IHyracksTaskContext ctx) {
-        return RuntimeContext.get(ctx).getLocalResourceRepository();
-    }
-
-    @Override
-    public ResourceIdFactory getResourceIdFactory(IHyracksTaskContext ctx) {
-        return RuntimeContext.get(ctx).getResourceIdFactory();
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/btree/AbstractBTreeOperatorTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/btree/AbstractBTreeOperatorTest.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/btree/AbstractBTreeOperatorTest.java
index 1bec90c..94252b3 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/btree/AbstractBTreeOperatorTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/btree/AbstractBTreeOperatorTest.java
@@ -56,11 +56,11 @@ import org.apache.hyracks.storage.am.common.dataflow.TreeIndexInsertUpdateDelete
 import org.apache.hyracks.storage.am.common.freepage.LinkedMetadataPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
 import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.common.IStorageManagerInterface;
+import org.apache.hyracks.storage.common.IStorageManager;
 import org.apache.hyracks.storage.common.file.TransientLocalResourceFactoryProvider;
 import org.apache.hyracks.test.support.TestIndexLifecycleManagerProvider;
 import org.apache.hyracks.test.support.TestStorageManagerComponentHolder;
-import org.apache.hyracks.test.support.TestStorageManagerInterface;
+import org.apache.hyracks.test.support.TestStorageManager;
 import org.apache.hyracks.tests.am.common.ITreeIndexOperatorTestHelper;
 import org.apache.hyracks.tests.integration.AbstractIntegrationTest;
 import org.junit.After;
@@ -71,7 +71,7 @@ public abstract class AbstractBTreeOperatorTest extends AbstractIntegrationTest
         TestStorageManagerComponentHolder.init(8192, 20, 20);
     }
 
-    protected final IStorageManagerInterface storageManager = new TestStorageManagerInterface();
+    protected final IStorageManager storageManager = new TestStorageManager();
     protected final IIndexLifecycleManagerProvider lcManagerProvider = new TestIndexLifecycleManagerProvider();
     protected IIndexDataflowHelperFactory dataflowHelperFactory;
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/btree/LSMBTreeOperatorTestHelper.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/btree/LSMBTreeOperatorTestHelper.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/btree/LSMBTreeOperatorTestHelper.java
index 80f4d34..936bd13 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/btree/LSMBTreeOperatorTestHelper.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/btree/LSMBTreeOperatorTestHelper.java
@@ -28,7 +28,7 @@ import org.apache.hyracks.storage.am.lsm.btree.dataflow.LSMBTreeDataflowHelperFa
 import org.apache.hyracks.storage.am.lsm.common.impls.ConstantMergePolicyFactory;
 import org.apache.hyracks.storage.am.lsm.common.impls.NoOpIOOperationCallback;
 import org.apache.hyracks.storage.am.lsm.common.impls.SynchronousSchedulerProvider;
-import org.apache.hyracks.storage.am.lsm.common.impls.ThreadCountingOperationTrackerProvider;
+import org.apache.hyracks.storage.am.lsm.common.impls.ThreadCountingOperationTrackerFactory;
 import org.apache.hyracks.tests.am.common.LSMTreeOperatorTestHelper;
 
 public class LSMBTreeOperatorTestHelper extends LSMTreeOperatorTestHelper {
@@ -45,7 +45,7 @@ public class LSMBTreeOperatorTestHelper extends LSMTreeOperatorTestHelper {
 
     public IIndexDataflowHelperFactory createDataFlowHelperFactory() {
         return new LSMBTreeDataflowHelperFactory(virtualBufferCacheProvider, new ConstantMergePolicyFactory(),
-                MERGE_POLICY_PROPERTIES, ThreadCountingOperationTrackerProvider.INSTANCE,
+                MERGE_POLICY_PROPERTIES, ThreadCountingOperationTrackerFactory.INSTANCE,
                 SynchronousSchedulerProvider.INSTANCE, NoOpIOOperationCallback.INSTANCE,
                 DEFAULT_BLOOM_FILTER_FALSE_POSITIVE_RATE, true, null, null, null, null, true);
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ef9be0f9/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/rtree/LSMRTreeOperatorTestHelper.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/rtree/LSMRTreeOperatorTestHelper.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/rtree/LSMRTreeOperatorTestHelper.java
index c1f2cf4..f4c80c1 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/rtree/LSMRTreeOperatorTestHelper.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/am/lsm/rtree/LSMRTreeOperatorTestHelper.java
@@ -30,7 +30,7 @@ import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory
 import org.apache.hyracks.storage.am.lsm.common.impls.ConstantMergePolicyFactory;
 import org.apache.hyracks.storage.am.lsm.common.impls.NoOpIOOperationCallback;
 import org.apache.hyracks.storage.am.lsm.common.impls.SynchronousSchedulerProvider;
-import org.apache.hyracks.storage.am.lsm.common.impls.ThreadCountingOperationTrackerProvider;
+import org.apache.hyracks.storage.am.lsm.common.impls.ThreadCountingOperationTrackerFactory;
 import org.apache.hyracks.storage.am.lsm.rtree.dataflow.LSMRTreeDataflowHelperFactory;
 import org.apache.hyracks.storage.am.rtree.frames.RTreePolicyType;
 import org.apache.hyracks.tests.am.common.LSMTreeOperatorTestHelper;
@@ -53,7 +53,7 @@ public class LSMRTreeOperatorTestHelper extends LSMTreeOperatorTestHelper {
             int[] btreeFields) {
         return new LSMRTreeDataflowHelperFactory(valueProviderFactories, rtreePolicyType, btreeComparatorFactories,
                 virtualBufferCacheProvider, new ConstantMergePolicyFactory(), MERGE_POLICY_PROPERTIES,
-                ThreadCountingOperationTrackerProvider.INSTANCE, SynchronousSchedulerProvider.INSTANCE,
+                ThreadCountingOperationTrackerFactory.INSTANCE, SynchronousSchedulerProvider.INSTANCE,
                 NoOpIOOperationCallback.INSTANCE, linearizerCmpFactory, DEFAULT_BLOOM_FILTER_FALSE_POSITIVE_RATE, null,
                 btreeFields, null, null, null, true, false);
     }


Mime
View raw message