asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [24/85] [abbrv] [partial] incubator-asterixdb-hyracks git commit: Move Pregelix and Hivesterix codebase to new repositories: 1. Move Pregelix codebase to https://github.com/pregelix/pregelix; 2. Move Hivesterix codebase to https://code.google.com/p/hives
Date Fri, 24 Apr 2015 18:45:51 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyByte.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyByte.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyByte.java
deleted file mode 100644
index aac90fe..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyByte.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.ByteWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyByteObjectInspector;
-
-/**
- * LazyObject for storing a value of Byte.
- * <p>
- * Part of the code is adapted from Apache Harmony Project. As with the specification, this implementation relied on code laid out in <a href="http://www.hackersdelight.org/">Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002)</a> as well as <a href="http://aggregate.org/MAGIC/">The Aggregate's Magic Algorithms</a>.
- * </p>
- */
-public class LazyByte extends LazyPrimitive<LazyByteObjectInspector, ByteWritable> {
-
-    public LazyByte(LazyByteObjectInspector oi) {
-        super(oi);
-        data = new ByteWritable();
-    }
-
-    public LazyByte(LazyByte copy) {
-        super(copy);
-        data = new ByteWritable(copy.data.get());
-    }
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        assert (1 == length);
-        data.set(bytes[start]);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyColumnar.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyColumnar.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyColumnar.java
deleted file mode 100644
index 0da8c7a..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyColumnar.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.hadoop.hive.serde2.objectinspector.StructField;
-import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyColumnarObjectInspector;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-/**
- * LazyObject for storing a struct. The field of a struct can be primitive or
- * non-primitive.
- * LazyStruct does not deal with the case of a NULL struct. That is handled by
- * the parent LazyObject.
- */
-@SuppressWarnings("rawtypes")
-public class LazyColumnar extends LazyNonPrimitive<LazyColumnarObjectInspector> {
-
-    /**
-     * IFrameTupleReference: the backend of the struct
-     */
-    IFrameTupleReference tuple;
-
-    /**
-     * Whether the data is already parsed or not.
-     */
-    boolean reset;
-
-    /**
-     * The fields of the struct.
-     */
-    LazyObject[] fields;
-
-    /**
-     * Whether init() has been called on the field or not.
-     */
-    boolean[] fieldVisited;
-
-    /**
-     * whether it is the first time initialization
-     */
-    boolean start = true;
-
-    /**
-     * Construct a LazyStruct object with the ObjectInspector.
-     */
-    public LazyColumnar(LazyColumnarObjectInspector oi) {
-        super(oi);
-    }
-
-    /**
-     * Set the row data for this LazyStruct.
-     * 
-     * @see LazyObject#init(ByteArrayRef, int, int)
-     */
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        super.init(bytes, start, length);
-        reset = false;
-    }
-
-    /**
-     * Parse the byte[] and fill each field.
-     */
-    private void parse() {
-
-        if (start) {
-            // initialize field array and reusable objects
-            List<? extends StructField> fieldRefs = ((StructObjectInspector) oi).getAllStructFieldRefs();
-
-            fields = new LazyObject[fieldRefs.size()];
-            for (int i = 0; i < fields.length; i++) {
-                fields[i] = LazyFactory.createLazyObject(fieldRefs.get(i).getFieldObjectInspector());
-            }
-            fieldVisited = new boolean[fields.length];
-            start = false;
-        }
-
-        Arrays.fill(fieldVisited, false);
-        reset = true;
-    }
-
-    /**
-     * Get one field out of the struct.
-     * If the field is a primitive field, return the actual object. Otherwise
-     * return the LazyObject. This is because PrimitiveObjectInspector does not
-     * have control over the object used by the user - the user simply directly
-     * use the Object instead of going through Object
-     * PrimitiveObjectInspector.get(Object).
-     * 
-     * @param fieldID
-     *            The field ID
-     * @return The field as a LazyObject
-     */
-    public Object getField(int fieldID) {
-        if (!reset) {
-            parse();
-        }
-        return uncheckedGetField(fieldID);
-    }
-
-    /**
-     * Get the field out of the row without checking parsed. This is called by
-     * both getField and getFieldsAsList.
-     * 
-     * @param fieldID
-     *            The id of the field starting from 0.
-     * @param nullSequence
-     *            The sequence representing NULL value.
-     * @return The value of the field
-     */
-    private Object uncheckedGetField(int fieldID) {
-        // get the buffer
-        byte[] buffer = tuple.getFieldData(fieldID);
-        // get the offset of the field
-        int s1 = tuple.getFieldStart(fieldID);
-        int l1 = tuple.getFieldLength(fieldID);
-
-        if (!fieldVisited[fieldID]) {
-            fieldVisited[fieldID] = true;
-            fields[fieldID].init(buffer, s1, l1);
-        }
-        // if (fields[fieldID].getObject() == null) {
-        // throw new IllegalStateException("illegal field " + fieldID);
-        // }
-        return fields[fieldID].getObject();
-    }
-
-    ArrayList<Object> cachedList;
-
-    /**
-     * Get the values of the fields as an ArrayList.
-     * 
-     * @return The values of the fields as an ArrayList.
-     */
-    public ArrayList<Object> getFieldsAsList() {
-        if (!reset) {
-            parse();
-        }
-        if (cachedList == null) {
-            cachedList = new ArrayList<Object>();
-        } else {
-            cachedList.clear();
-        }
-        for (int i = 0; i < fields.length; i++) {
-            cachedList.add(uncheckedGetField(i));
-        }
-        return cachedList;
-    }
-
-    @Override
-    public Object getObject() {
-        return this;
-    }
-
-    protected boolean getParsed() {
-        return reset;
-    }
-
-    protected void setParsed(boolean parsed) {
-        this.reset = parsed;
-    }
-
-    protected LazyObject[] getFields() {
-        return fields;
-    }
-
-    protected void setFields(LazyObject[] fields) {
-        this.fields = fields;
-    }
-
-    protected boolean[] getFieldInited() {
-        return fieldVisited;
-    }
-
-    protected void setFieldInited(boolean[] fieldInited) {
-        this.fieldVisited = fieldInited;
-    }
-
-    /**
-     * rebind a frametuplereference to the struct
-     */
-    public void init(IFrameTupleReference r) {
-        this.tuple = r;
-        reset = false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyDouble.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyDouble.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyDouble.java
deleted file mode 100644
index 425f4f3..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyDouble.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.DoubleWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyDoubleObjectInspector;
-
-/**
- * LazyObject for storing a value of Double.
- */
-public class LazyDouble extends LazyPrimitive<LazyDoubleObjectInspector, DoubleWritable> {
-
-    public LazyDouble(LazyDoubleObjectInspector oi) {
-        super(oi);
-        data = new DoubleWritable();
-    }
-
-    public LazyDouble(LazyDouble copy) {
-        super(copy);
-        data = new DoubleWritable(copy.data.get());
-    }
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-        assert (8 == length);
-        data.set(Double.longBitsToDouble(LazyUtils.byteArrayToLong(bytes, start)));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFactory.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFactory.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFactory.java
deleted file mode 100644
index 2870fa4..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFactory.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyColumnarObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyListObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyMapObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyStructObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyBooleanObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyByteObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyDoubleObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyFloatObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyIntObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyLongObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyShortObjectInspector;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyStringObjectInspector;
-
-/**
- * LazyFactory.
- */
-public final class LazyFactory {
-
-    /**
-     * Create a lazy binary primitive class given the type name.
-     */
-    public static LazyPrimitive<?, ?> createLazyPrimitiveClass(PrimitiveObjectInspector oi) {
-        PrimitiveCategory p = oi.getPrimitiveCategory();
-        switch (p) {
-            case BOOLEAN:
-                return new LazyBoolean((LazyBooleanObjectInspector) oi);
-            case BYTE:
-                return new LazyByte((LazyByteObjectInspector) oi);
-            case SHORT:
-                return new LazyShort((LazyShortObjectInspector) oi);
-            case INT:
-                return new LazyInteger((LazyIntObjectInspector) oi);
-            case LONG:
-                return new LazyLong((LazyLongObjectInspector) oi);
-            case FLOAT:
-                return new LazyFloat((LazyFloatObjectInspector) oi);
-            case DOUBLE:
-                return new LazyDouble((LazyDoubleObjectInspector) oi);
-            case STRING:
-                return new LazyString((LazyStringObjectInspector) oi);
-            default:
-                throw new RuntimeException("Internal error: no LazyObject for " + p);
-        }
-    }
-
-    /**
-     * Create a hierarchical LazyObject based on the given typeInfo.
-     */
-    public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) {
-        ObjectInspector.Category c = oi.getCategory();
-        switch (c) {
-            case PRIMITIVE:
-                return createLazyPrimitiveClass((PrimitiveObjectInspector) oi);
-            case MAP:
-                return new LazyMap((LazyMapObjectInspector) oi);
-            case LIST:
-                return new LazyArray((LazyListObjectInspector) oi);
-            case STRUCT: // check whether it is a top-level struct
-                if (oi instanceof LazyStructObjectInspector)
-                    return new LazyStruct((LazyStructObjectInspector) oi);
-                else
-                    return new LazyColumnar((LazyColumnarObjectInspector) oi);
-            default:
-                throw new RuntimeException("Hive LazySerDe Internal error.");
-        }
-    }
-
-    private LazyFactory() {
-        // prevent instantiation
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFloat.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFloat.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFloat.java
deleted file mode 100644
index 5ec5cac..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyFloat.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.FloatWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyFloatObjectInspector;
-
-/**
- * LazyObject for storing a value of Double.
- */
-public class LazyFloat extends LazyPrimitive<LazyFloatObjectInspector, FloatWritable> {
-
-    public LazyFloat(LazyFloatObjectInspector oi) {
-        super(oi);
-        data = new FloatWritable();
-    }
-
-    public LazyFloat(LazyFloat copy) {
-        super(copy);
-        data = new FloatWritable(copy.data.get());
-    }
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        assert (4 == length);
-        data.set(Float.intBitsToFloat(LazyUtils.byteArrayToInt(bytes, start)));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyInteger.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyInteger.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyInteger.java
deleted file mode 100644
index e108364..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyInteger.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.IntWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.LazyUtils.VInt;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyIntObjectInspector;
-
-/**
- * LazyObject for storing a value of Integer.
- * <p>
- * Part of the code is adapted from Apache Harmony Project. As with the specification, this implementation relied on code laid out in <a href="http://www.hackersdelight.org/">Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002)</a> as well as <a href="http://aggregate.org/MAGIC/">The Aggregate's Magic Algorithms</a>.
- * </p>
- */
-public class LazyInteger extends LazyPrimitive<LazyIntObjectInspector, IntWritable> {
-
-    public LazyInteger(LazyIntObjectInspector oi) {
-        super(oi);
-        data = new IntWritable();
-    }
-
-    public LazyInteger(LazyInteger copy) {
-        super(copy);
-        data = new IntWritable(copy.data.get());
-    }
-
-    /**
-     * The reusable vInt for decoding the integer.
-     */
-    VInt vInt = new LazyUtils.VInt();
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        LazyUtils.readVInt(bytes, start, vInt);
-        assert (length == vInt.length);
-        if (length != vInt.length)
-            throw new IllegalStateException("parse int: length mismatch, expected " + vInt.length + " but get "
-                    + length);
-        data.set(vInt.value);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyLong.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyLong.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyLong.java
deleted file mode 100644
index 8540805..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyLong.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.LongWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.LazyUtils.VLong;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyLongObjectInspector;
-
-/**
- * LazyObject for storing a value of Long.
- * <p>
- * Part of the code is adapted from Apache Harmony Project. As with the specification, this implementation relied on code laid out in <a href="http://www.hackersdelight.org/">Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002)</a> as well as <a href="http://aggregate.org/MAGIC/">The Aggregate's Magic Algorithms</a>.
- * </p>
- */
-public class LazyLong extends LazyPrimitive<LazyLongObjectInspector, LongWritable> {
-
-    public LazyLong(LazyLongObjectInspector oi) {
-        super(oi);
-        data = new LongWritable();
-    }
-
-    public LazyLong(LazyLong copy) {
-        super(copy);
-        data = new LongWritable(copy.data.get());
-    }
-
-    /**
-     * The reusable vLong for decoding the long.
-     */
-    VLong vLong = new LazyUtils.VLong();
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        LazyUtils.readVLong(bytes, start, vLong);
-        assert (length == vLong.length);
-        if (length != vLong.length)
-            throw new IllegalStateException("parse long: length mismatch");
-        data.set(vLong.value);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyMap.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyMap.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyMap.java
deleted file mode 100644
index 6fe9739..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyMap.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hive.serde2.lazy.ByteArrayRef;
-import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-
-import edu.uci.ics.hivesterix.serde.lazy.LazyUtils.RecordInfo;
-import edu.uci.ics.hivesterix.serde.lazy.LazyUtils.VInt;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.LazyMapObjectInspector;
-
-/**
- * LazyMap is serialized as follows: start A b c b c b c end bytes[] ->
- * |--------|---|---|---|---| ... |---|---|
- * Section A is the null-bytes. Suppose the map has N key-value pairs, then
- * there are (N*2+7)/8 bytes used as null-bytes. Each bit corresponds to a key
- * or a value and it indicates whether that key or value is null (0) or not null
- * (1).
- * After A, all the bytes are actual serialized data of the map, which are
- * key-value pairs. b represent the keys and c represent the values. Each of
- * them is again a LazyObject.
- */
-
-@SuppressWarnings("rawtypes")
-public class LazyMap extends LazyNonPrimitive<LazyMapObjectInspector> {
-
-    private static Log LOG = LogFactory.getLog(LazyMap.class.getName());
-
-    /**
-     * Whether the data is already parsed or not.
-     */
-    boolean parsed;
-
-    /**
-     * The size of the map. Only valid when the data is parsed. -1 when the map
-     * is NULL.
-     */
-    int mapSize = 0;
-
-    /**
-     * The beginning position and length of key[i] and value[i]. Only valid when
-     * the data is parsed.
-     */
-    int[] keyStart;
-    int[] keyLength;
-    int[] valueStart;
-    int[] valueLength;
-    /**
-     * Whether valueObjects[i]/keyObjects[i] is initialized or not.
-     */
-    boolean[] keyInited;
-    boolean[] valueInited;
-
-    /**
-     * Whether valueObjects[i]/keyObjects[i] is null or not This could not be
-     * inferred from the length of the object. In particular, a 0-length string
-     * is not null.
-     */
-    boolean[] keyIsNull;
-    boolean[] valueIsNull;
-
-    /**
-     * The keys are stored in an array of LazyPrimitives.
-     */
-    LazyPrimitive<?, ?>[] keyObjects;
-    /**
-     * The values are stored in an array of LazyObjects. value[index] will start
-     * from KeyEnd[index] + 1, and ends before KeyStart[index+1] - 1.
-     */
-    LazyObject[] valueObjects;
-
-    protected LazyMap(LazyMapObjectInspector oi) {
-        super(oi);
-    }
-
-    /**
-     * Set the row data for this LazyMap.
-     * 
-     * @see LazyObject#init(ByteArrayRef, int, int)
-     */
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        super.init(bytes, start, length);
-        parsed = false;
-    }
-
-    /**
-     * Adjust the size of arrays: keyStart, keyLength valueStart, valueLength
-     * keyInited, keyIsNull valueInited, valueIsNull.
-     */
-    protected void adjustArraySize(int newSize) {
-        if (keyStart == null || keyStart.length < newSize) {
-            keyStart = new int[newSize];
-            keyLength = new int[newSize];
-            valueStart = new int[newSize];
-            valueLength = new int[newSize];
-            keyInited = new boolean[newSize];
-            keyIsNull = new boolean[newSize];
-            valueInited = new boolean[newSize];
-            valueIsNull = new boolean[newSize];
-            keyObjects = new LazyPrimitive<?, ?>[newSize];
-            valueObjects = new LazyObject[newSize];
-        }
-    }
-
-    boolean nullMapKey = false;
-    VInt vInt = new LazyUtils.VInt();
-    RecordInfo recordInfo = new LazyUtils.RecordInfo();
-
-    /**
-     * Parse the byte[] and fill keyStart, keyLength, keyIsNull valueStart,
-     * valueLength and valueIsNull.
-     */
-    private void parse() {
-
-        // get the VInt that represents the map size
-        LazyUtils.readVInt(bytes, start, vInt);
-        mapSize = vInt.value;
-        if (0 == mapSize) {
-            parsed = true;
-            return;
-        }
-
-        // adjust arrays
-        adjustArraySize(mapSize);
-
-        // find out the null-bytes
-        int mapByteStart = start + vInt.length;
-        int nullByteCur = mapByteStart;
-        int nullByteEnd = mapByteStart + (mapSize * 2 + 7) / 8;
-        int lastElementByteEnd = nullByteEnd;
-
-        // parsing the keys and values one by one
-        for (int i = 0; i < mapSize; i++) {
-            // parse a key
-            keyIsNull[i] = true;
-            if ((bytes[nullByteCur] & (1 << ((i * 2) % 8))) != 0) {
-                keyIsNull[i] = false;
-                LazyUtils.checkObjectByteInfo(((MapObjectInspector) oi).getMapKeyObjectInspector(), bytes,
-                        lastElementByteEnd, recordInfo);
-                keyStart[i] = lastElementByteEnd + recordInfo.elementOffset;
-                keyLength[i] = recordInfo.elementSize;
-                lastElementByteEnd = keyStart[i] + keyLength[i];
-            } else if (!nullMapKey) {
-                nullMapKey = true;
-                LOG.warn("Null map key encountered! Ignoring similar problems.");
-            }
-
-            // parse a value
-            valueIsNull[i] = true;
-            if ((bytes[nullByteCur] & (1 << ((i * 2 + 1) % 8))) != 0) {
-                valueIsNull[i] = false;
-                LazyUtils.checkObjectByteInfo(((MapObjectInspector) oi).getMapValueObjectInspector(), bytes,
-                        lastElementByteEnd, recordInfo);
-                valueStart[i] = lastElementByteEnd + recordInfo.elementOffset;
-                valueLength[i] = recordInfo.elementSize;
-                lastElementByteEnd = valueStart[i] + valueLength[i];
-            }
-
-            // move onto the next null byte
-            if (3 == (i % 4)) {
-                nullByteCur++;
-            }
-        }
-
-        Arrays.fill(keyInited, 0, mapSize, false);
-        Arrays.fill(valueInited, 0, mapSize, false);
-        parsed = true;
-    }
-
-    /**
-     * Get the value object with the index without checking parsed.
-     * 
-     * @param index
-     *            The index into the array starting from 0
-     */
-    private LazyObject uncheckedGetValue(int index) {
-        if (valueIsNull[index]) {
-            return null;
-        }
-        if (!valueInited[index]) {
-            valueInited[index] = true;
-            if (valueObjects[index] == null) {
-                valueObjects[index] = LazyFactory.createLazyObject(((MapObjectInspector) oi)
-                        .getMapValueObjectInspector());
-            }
-            valueObjects[index].init(bytes, valueStart[index], valueLength[index]);
-        }
-        return valueObjects[index];
-    }
-
-    /**
-     * Get the value in the map for the key.
-     * If there are multiple matches (which is possible in the serialized
-     * format), only the first one is returned.
-     * The most efficient way to get the value for the key is to serialize the
-     * key and then try to find it in the array. We do linear search because in
-     * most cases, user only wants to get one or two values out of the map, and
-     * the cost of building up a HashMap is substantially higher.
-     * 
-     * @param key
-     *            The key object that we are looking for.
-     * @return The corresponding value object, or NULL if not found
-     */
-    public Object getMapValueElement(Object key) {
-        if (!parsed) {
-            parse();
-        }
-        // search for the key
-        for (int i = 0; i < mapSize; i++) {
-            LazyPrimitive<?, ?> lazyKeyI = uncheckedGetKey(i);
-            if (lazyKeyI == null) {
-                continue;
-            }
-            // getWritableObject() will convert LazyPrimitive to actual
-            // primitive
-            // writable objects.
-            Object keyI = lazyKeyI.getWritableObject();
-            if (keyI == null) {
-                continue;
-            }
-            if (keyI.equals(key)) {
-                // Got a match, return the value
-                LazyObject v = uncheckedGetValue(i);
-                return v == null ? v : v.getObject();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Get the key object with the index without checking parsed.
-     * 
-     * @param index
-     *            The index into the array starting from 0
-     */
-    private LazyPrimitive<?, ?> uncheckedGetKey(int index) {
-        if (keyIsNull[index]) {
-            return null;
-        }
-        if (!keyInited[index]) {
-            keyInited[index] = true;
-            if (keyObjects[index] == null) {
-                // Keys are always primitive
-                keyObjects[index] = LazyFactory
-                        .createLazyPrimitiveClass((PrimitiveObjectInspector) ((MapObjectInspector) oi)
-                                .getMapKeyObjectInspector());
-            }
-            keyObjects[index].init(bytes, keyStart[index], keyLength[index]);
-        }
-        return keyObjects[index];
-    }
-
-    /**
-     * cachedMap is reused for different calls to getMap(). But each LazyMap has
-     * a separate cachedMap so we won't overwrite the data by accident.
-     */
-    LinkedHashMap<Object, Object> cachedMap;
-
-    /**
-     * Return the map object representing this LazyMap. Note that the keyObjects
-     * will be Writable primitive objects.
-     * 
-     * @return the map object
-     */
-    public Map<Object, Object> getMap() {
-        if (!parsed) {
-            parse();
-        }
-        if (cachedMap == null) {
-            // Use LinkedHashMap to provide deterministic order
-            cachedMap = new LinkedHashMap<Object, Object>();
-        } else {
-            cachedMap.clear();
-        }
-
-        // go through each element of the map
-        for (int i = 0; i < mapSize; i++) {
-            LazyPrimitive<?, ?> lazyKey = uncheckedGetKey(i);
-            if (lazyKey == null) {
-                continue;
-            }
-            Object key = lazyKey.getObject();
-            // do not overwrite if there are duplicate keys
-            if (key != null && !cachedMap.containsKey(key)) {
-                LazyObject lazyValue = uncheckedGetValue(i);
-                Object value = (lazyValue == null ? null : lazyValue.getObject());
-                cachedMap.put(key, value);
-            }
-        }
-        return cachedMap;
-    }
-
-    /**
-     * Get the size of the map represented by this LazyMap.
-     * 
-     * @return The size of the map
-     */
-    public int getMapSize() {
-        if (!parsed) {
-            parse();
-        }
-        return mapSize;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyNonPrimitive.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyNonPrimitive.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyNonPrimitive.java
deleted file mode 100644
index 9438a51..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyNonPrimitive.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-/**
- * LazyPrimitive stores a primitive Object in a LazyObject.
- */
-public abstract class LazyNonPrimitive<OI extends ObjectInspector> extends LazyObject<OI> {
-
-    protected byte[] bytes;
-    protected int start;
-    protected int length;
-
-    /**
-     * Create a LazyNonPrimitive object with the specified ObjectInspector.
-     * 
-     * @param oi
-     *            The ObjectInspector would have to have a hierarchy of
-     *            LazyObjectInspectors with the leaf nodes being
-     *            WritableObjectInspectors. It's used both for accessing the
-     *            type hierarchy of the complex object, as well as getting meta
-     *            information (separator, nullSequence, etc) when parsing the
-     *            lazy object.
-     */
-    protected LazyNonPrimitive(OI oi) {
-        super(oi);
-        bytes = null;
-        start = 0;
-        length = 0;
-    }
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (bytes == null) {
-            throw new RuntimeException("bytes cannot be null!");
-        }
-        this.bytes = bytes;
-        this.start = start;
-        this.length = length;
-        assert start >= 0;
-        assert start + length <= bytes.length;
-    }
-
-    @Override
-    public Object getObject() {
-        return this;
-    }
-
-    @Override
-    public int hashCode() {
-        return LazyUtils.hashBytes(bytes, start, length);
-    }
-
-    @Override
-    public void init(IFrameTupleReference tuple) {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyObject.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyObject.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyObject.java
deleted file mode 100644
index 7b04c0d..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyObject.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-/**
- * LazyObject stores an object in a range of bytes in a byte[].
- * A LazyObject can represent any primitive object or hierarchical object like
- * array, map or struct.
- */
-public abstract class LazyObject<OI extends ObjectInspector> {
-
-    OI oi;
-
-    /**
-     * Create a LazyObject.
-     * 
-     * @param oi
-     *            Derived classes can access meta information about this Lazy
-     *            Object (e.g, separator, nullSequence, escaper) from it.
-     */
-    protected LazyObject(OI oi) {
-        this.oi = oi;
-    }
-
-    /**
-     * Set the data for this LazyObject. We take ByteArrayRef instead of byte[]
-     * so that we will be able to drop the reference to byte[] by a single
-     * assignment. The ByteArrayRef object can be reused across multiple rows.
-     * 
-     * @param bytes
-     *            The wrapper of the byte[].
-     * @param start
-     *            The start position inside the bytes.
-     * @param length
-     *            The length of the data, starting from "start"
-     * @see ByteArrayRef
-     */
-    public abstract void init(byte[] bytes, int start, int length);
-
-    public abstract void init(IFrameTupleReference tuple);
-
-    /**
-     * If the LazyObject is a primitive Object, then deserialize it and return
-     * the actual primitive Object. Otherwise (array, map, struct), return this.
-     */
-    public abstract Object getObject();
-
-    @Override
-    public abstract int hashCode();
-
-    protected OI getInspector() {
-        return oi;
-    }
-
-    protected void setInspector(OI oi) {
-        this.oi = oi;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyPrimitive.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyPrimitive.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyPrimitive.java
deleted file mode 100644
index 110035e..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyPrimitive.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.io.Writable;
-
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
-
-/**
- * LazyPrimitive stores a primitive Object in a LazyObject.
- */
-public abstract class LazyPrimitive<OI extends ObjectInspector, T extends Writable> extends LazyObject<OI> {
-
-    LazyPrimitive(OI oi) {
-        super(oi);
-    }
-
-    LazyPrimitive(LazyPrimitive<OI, T> copy) {
-        super(copy.oi);
-        isNull = copy.isNull;
-    }
-
-    T data;
-    boolean isNull = false;
-
-    /**
-     * Returns the primitive object represented by this LazyObject. This is
-     * useful because it can make sure we have "null" for null objects.
-     */
-    @Override
-    public Object getObject() {
-        return isNull ? null : this;
-    }
-
-    public T getWritableObject() {
-        return isNull ? null : data;
-    }
-
-    @Override
-    public String toString() {
-        return isNull ? "null" : data.toString();
-    }
-
-    @Override
-    public int hashCode() {
-        return isNull ? 0 : data.hashCode();
-    }
-
-    @Override
-    public void init(IFrameTupleReference tuple) {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazySerDe.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazySerDe.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazySerDe.java
deleted file mode 100644
index 2bbb1d5..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazySerDe.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.serde.Constants;
-import org.apache.hadoop.hive.serde2.ByteStream;
-import org.apache.hadoop.hive.serde2.ByteStream.Output;
-import org.apache.hadoop.hive.serde2.SerDe;
-import org.apache.hadoop.hive.serde2.SerDeException;
-import org.apache.hadoop.hive.serde2.SerDeStats;
-import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
-import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.StructField;
-import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.ByteObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.FloatObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
-import org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspector;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
-import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-
-/**
- * The LazySerDe class combines the lazy property of LazySimpleSerDe class and
- * the binary property of BinarySortable class. Lazy means a field is not
- * deserialized until required. Binary means a field is serialized in binary
- * compact format.
- */
-@SuppressWarnings("deprecation")
-public class LazySerDe implements SerDe {
-
-    public static final Log LOG = LogFactory.getLog(LazySerDe.class.getName());
-
-    public LazySerDe() {
-    }
-
-    List<String> columnNames;
-    List<TypeInfo> columnTypes;
-
-    TypeInfo rowTypeInfo;
-    ObjectInspector cachedObjectInspector;
-
-    // The object for storing row data
-    LazyColumnar cachedLazyStruct;
-
-    /**
-     * Initialize the SerDe with configuration and table information.
-     */
-    @Override
-    public void initialize(Configuration conf, Properties tbl) throws SerDeException {
-        // Get column names and types
-        String columnNameProperty = tbl.getProperty(Constants.LIST_COLUMNS);
-        String columnTypeProperty = tbl.getProperty(Constants.LIST_COLUMN_TYPES);
-        if (columnNameProperty.length() == 0) {
-            columnNames = new ArrayList<String>();
-        } else {
-            columnNames = Arrays.asList(columnNameProperty.split(","));
-        }
-        if (columnTypeProperty.length() == 0) {
-            columnTypes = new ArrayList<TypeInfo>();
-        } else {
-            columnTypes = TypeInfoUtils.getTypeInfosFromTypeString(columnTypeProperty);
-        }
-        assert (columnNames.size() == columnTypes.size());
-        // Create row related objects
-        rowTypeInfo = TypeInfoFactory.getStructTypeInfo(columnNames, columnTypes);
-        // Create the object inspector and the lazy binary struct object
-        cachedObjectInspector = LazyUtils.getLazyObjectInspectorFromTypeInfo(rowTypeInfo, true);
-        cachedLazyStruct = (LazyColumnar) LazyFactory.createLazyObject(cachedObjectInspector);
-        // output debug info
-        LOG.debug("LazySerDe initialized with: columnNames=" + columnNames + " columnTypes=" + columnTypes);
-    }
-
-    /**
-     * Returns the ObjectInspector for the row.
-     */
-    @Override
-    public ObjectInspector getObjectInspector() throws SerDeException {
-        return cachedObjectInspector;
-    }
-
-    /**
-     * Returns the Writable Class after serialization.
-     */
-    @Override
-    public Class<? extends Writable> getSerializedClass() {
-        return BytesWritable.class;
-    }
-
-    // The wrapper for byte array
-    ByteArrayRef byteArrayRef;
-
-    /**
-     * Deserialize a table record to a Lazy struct.
-     */
-    @Override
-    public Object deserialize(Writable field) throws SerDeException {
-        if (byteArrayRef == null) {
-            byteArrayRef = new ByteArrayRef();
-        }
-        if (field instanceof BytesWritable) {
-            BytesWritable b = (BytesWritable) field;
-            if (b.getSize() == 0) {
-                return null;
-            }
-            // For backward-compatibility with hadoop 0.17
-            byteArrayRef.setData(b.get());
-            cachedLazyStruct.init(byteArrayRef.getData(), 0, b.getSize());
-        } else if (field instanceof Text) {
-            Text t = (Text) field;
-            if (t.getLength() == 0) {
-                return null;
-            }
-            byteArrayRef.setData(t.getBytes());
-            cachedLazyStruct.init(byteArrayRef.getData(), 0, t.getLength());
-        } else {
-            throw new SerDeException(getClass().toString() + ": expects either BytesWritable or Text object!");
-        }
-        return cachedLazyStruct;
-    }
-
-    /**
-     * The reusable output buffer and serialize byte buffer.
-     */
-    BytesWritable serializeBytesWritable = new BytesWritable();
-    ByteStream.Output serializeByteStream = new ByteStream.Output();
-
-    /**
-     * Serialize an object to a byte buffer in a binary compact way.
-     */
-    @Override
-    public Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException {
-        // make sure it is a struct record or not
-        serializeByteStream.reset();
-
-        if (objInspector.getCategory() != Category.STRUCT) {
-            // serialize the primitive object
-            serialize(serializeByteStream, obj, objInspector);
-        } else {
-            // serialize the row as a struct
-            serializeStruct(serializeByteStream, obj, (StructObjectInspector) objInspector);
-        }
-        // return the serialized bytes
-        serializeBytesWritable.set(serializeByteStream.getData(), 0, serializeByteStream.getCount());
-        return serializeBytesWritable;
-    }
-
-    boolean nullMapKey = false;
-
-    /**
-     * Serialize a struct object without writing the byte size. This function is
-     * shared by both row serialization and struct serialization.
-     * 
-     * @param byteStream
-     *            the byte stream storing the serialization data
-     * @param obj
-     *            the struct object to serialize
-     * @param objInspector
-     *            the struct object inspector
-     */
-    private void serializeStruct(Output byteStream, Object obj, StructObjectInspector soi) {
-        // do nothing for null struct
-        if (null == obj) {
-            return;
-        }
-        /*
-         * Interleave serializing one null byte and 8 struct fields in each
-         * round, in order to support data deserialization with different table
-         * schemas
-         */
-        List<? extends StructField> fields = soi.getAllStructFieldRefs();
-        int size = fields.size();
-        int lasti = 0;
-        byte nullByte = 0;
-        for (int i = 0; i < size; i++) {
-            // set bit to 1 if a field is not null
-            if (null != soi.getStructFieldData(obj, fields.get(i))) {
-                nullByte |= 1 << (i % 8);
-            }
-            // write the null byte every eight elements or
-            // if this is the last element and serialize the
-            // corresponding 8 struct fields at the same time
-            if (7 == i % 8 || i == size - 1) {
-                serializeByteStream.write(nullByte);
-                for (int j = lasti; j <= i; j++) {
-                    serialize(serializeByteStream, soi.getStructFieldData(obj, fields.get(j)), fields.get(j)
-                            .getFieldObjectInspector());
-                }
-                lasti = i + 1;
-                nullByte = 0;
-            }
-        }
-    }
-
-    /**
-     * A recursive function that serialize an object to a byte buffer based on
-     * its object inspector.
-     * 
-     * @param byteStream
-     *            the byte stream storing the serialization data
-     * @param obj
-     *            the object to serialize
-     * @param objInspector
-     *            the object inspector
-     */
-    private void serialize(Output byteStream, Object obj, ObjectInspector objInspector) {
-
-        // do nothing for null object
-        if (null == obj) {
-            return;
-        }
-
-        switch (objInspector.getCategory()) {
-            case PRIMITIVE: {
-                PrimitiveObjectInspector poi = (PrimitiveObjectInspector) objInspector;
-                switch (poi.getPrimitiveCategory()) {
-                    case VOID: {
-                        return;
-                    }
-                    case BOOLEAN: {
-                        boolean v = ((BooleanObjectInspector) poi).get(obj);
-                        byteStream.write((byte) (v ? 1 : 0));
-                        return;
-                    }
-                    case BYTE: {
-                        ByteObjectInspector boi = (ByteObjectInspector) poi;
-                        byte v = boi.get(obj);
-                        byteStream.write(v);
-                        return;
-                    }
-                    case SHORT: {
-                        ShortObjectInspector spoi = (ShortObjectInspector) poi;
-                        short v = spoi.get(obj);
-                        byteStream.write((byte) (v >> 8));
-                        byteStream.write((byte) (v));
-                        return;
-                    }
-                    case INT: {
-                        IntObjectInspector ioi = (IntObjectInspector) poi;
-                        int v = ioi.get(obj);
-                        LazyUtils.writeVInt(byteStream, v);
-                        return;
-                    }
-                    case LONG: {
-                        LongObjectInspector loi = (LongObjectInspector) poi;
-                        long v = loi.get(obj);
-                        LazyUtils.writeVLong(byteStream, v);
-                        return;
-                    }
-                    case FLOAT: {
-                        FloatObjectInspector foi = (FloatObjectInspector) poi;
-                        int v = Float.floatToIntBits(foi.get(obj));
-                        byteStream.write((byte) (v >> 24));
-                        byteStream.write((byte) (v >> 16));
-                        byteStream.write((byte) (v >> 8));
-                        byteStream.write((byte) (v));
-                        return;
-                    }
-                    case DOUBLE: {
-                        DoubleObjectInspector doi = (DoubleObjectInspector) poi;
-                        long v = Double.doubleToLongBits(doi.get(obj));
-                        byteStream.write((byte) (v >> 56));
-                        byteStream.write((byte) (v >> 48));
-                        byteStream.write((byte) (v >> 40));
-                        byteStream.write((byte) (v >> 32));
-                        byteStream.write((byte) (v >> 24));
-                        byteStream.write((byte) (v >> 16));
-                        byteStream.write((byte) (v >> 8));
-                        byteStream.write((byte) (v));
-                        return;
-                    }
-                    case STRING: {
-                        StringObjectInspector soi = (StringObjectInspector) poi;
-                        Text t = soi.getPrimitiveWritableObject(obj);
-                        /* write byte size of the string which is a vint */
-                        int length = t.getLength();
-                        LazyUtils.writeVInt(byteStream, length);
-                        /* write string itself */
-                        byte[] data = t.getBytes();
-                        byteStream.write(data, 0, length);
-                        return;
-                    }
-                    default: {
-                        throw new RuntimeException("Unrecognized type: " + poi.getPrimitiveCategory());
-                    }
-                }
-            }
-            case LIST: {
-                ListObjectInspector loi = (ListObjectInspector) objInspector;
-                ObjectInspector eoi = loi.getListElementObjectInspector();
-
-                // 1/ reserve spaces for the byte size of the list
-                // which is a integer and takes four bytes
-                int byteSizeStart = byteStream.getCount();
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                int listStart = byteStream.getCount();
-
-                // 2/ write the size of the list as a VInt
-                int size = loi.getListLength(obj);
-                LazyUtils.writeVInt(byteStream, size);
-
-                // 3/ write the null bytes
-                byte nullByte = 0;
-                for (int eid = 0; eid < size; eid++) {
-                    // set the bit to 1 if an element is not null
-                    if (null != loi.getListElement(obj, eid)) {
-                        nullByte |= 1 << (eid % 8);
-                    }
-                    // store the byte every eight elements or
-                    // if this is the last element
-                    if (7 == eid % 8 || eid == size - 1) {
-                        byteStream.write(nullByte);
-                        nullByte = 0;
-                    }
-                }
-
-                // 4/ write element by element from the list
-                for (int eid = 0; eid < size; eid++) {
-                    serialize(byteStream, loi.getListElement(obj, eid), eoi);
-                }
-
-                // 5/ update the list byte size
-                int listEnd = byteStream.getCount();
-                int listSize = listEnd - listStart;
-                byte[] bytes = byteStream.getData();
-                bytes[byteSizeStart] = (byte) (listSize >> 24);
-                bytes[byteSizeStart + 1] = (byte) (listSize >> 16);
-                bytes[byteSizeStart + 2] = (byte) (listSize >> 8);
-                bytes[byteSizeStart + 3] = (byte) (listSize);
-
-                return;
-            }
-            case MAP: {
-                MapObjectInspector moi = (MapObjectInspector) objInspector;
-                ObjectInspector koi = moi.getMapKeyObjectInspector();
-                ObjectInspector voi = moi.getMapValueObjectInspector();
-                Map<?, ?> map = moi.getMap(obj);
-
-                // 1/ reserve spaces for the byte size of the map
-                // which is a integer and takes four bytes
-                int byteSizeStart = byteStream.getCount();
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                int mapStart = byteStream.getCount();
-
-                // 2/ write the size of the map which is a VInt
-                int size = map.size();
-                LazyUtils.writeVInt(byteStream, size);
-
-                // 3/ write the null bytes
-                int b = 0;
-                byte nullByte = 0;
-                for (Map.Entry<?, ?> entry : map.entrySet()) {
-                    // set the bit to 1 if a key is not null
-                    if (null != entry.getKey()) {
-                        nullByte |= 1 << (b % 8);
-                    } else if (!nullMapKey) {
-                        nullMapKey = true;
-                        LOG.warn("Null map key encountered! Ignoring similar problems.");
-                    }
-                    b++;
-                    // set the bit to 1 if a value is not null
-                    if (null != entry.getValue()) {
-                        nullByte |= 1 << (b % 8);
-                    }
-                    b++;
-                    // write the byte to stream every 4 key-value pairs
-                    // or if this is the last key-value pair
-                    if (0 == b % 8 || b == size * 2) {
-                        byteStream.write(nullByte);
-                        nullByte = 0;
-                    }
-                }
-
-                // 4/ write key-value pairs one by one
-                for (Map.Entry<?, ?> entry : map.entrySet()) {
-                    serialize(byteStream, entry.getKey(), koi);
-                    serialize(byteStream, entry.getValue(), voi);
-                }
-
-                // 5/ update the byte size of the map
-                int mapEnd = byteStream.getCount();
-                int mapSize = mapEnd - mapStart;
-                byte[] bytes = byteStream.getData();
-                bytes[byteSizeStart] = (byte) (mapSize >> 24);
-                bytes[byteSizeStart + 1] = (byte) (mapSize >> 16);
-                bytes[byteSizeStart + 2] = (byte) (mapSize >> 8);
-                bytes[byteSizeStart + 3] = (byte) (mapSize);
-
-                return;
-            }
-            case STRUCT: {
-                // 1/ reserve spaces for the byte size of the struct
-                // which is a integer and takes four bytes
-                int byteSizeStart = byteStream.getCount();
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                byteStream.write((byte) 0);
-                int structStart = byteStream.getCount();
-
-                // 2/ serialize the struct
-                serializeStruct(byteStream, obj, (StructObjectInspector) objInspector);
-
-                // 3/ update the byte size of the struct
-                int structEnd = byteStream.getCount();
-                int structSize = structEnd - structStart;
-                byte[] bytes = byteStream.getData();
-                bytes[byteSizeStart] = (byte) (structSize >> 24);
-                bytes[byteSizeStart + 1] = (byte) (structSize >> 16);
-                bytes[byteSizeStart + 2] = (byte) (structSize >> 8);
-                bytes[byteSizeStart + 3] = (byte) (structSize);
-
-                return;
-            }
-            default: {
-                throw new RuntimeException("Unrecognized type: " + objInspector.getCategory());
-            }
-        }
-    }
-
-	@Override
-	public SerDeStats getSerDeStats() {
-		return null;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyShort.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyShort.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyShort.java
deleted file mode 100644
index da28e64..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyShort.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.hive.serde2.io.ShortWritable;
-
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyShortObjectInspector;
-
-/**
- * LazyObject for storing a value of Short.
- * <p>
- * Part of the code is adapted from Apache Harmony Project. As with the specification, this implementation relied on code laid out in <a href="http://www.hackersdelight.org/">Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002)</a> as well as <a href="http://aggregate.org/MAGIC/">The Aggregate's Magic Algorithms</a>.
- * </p>
- */
-public class LazyShort extends LazyPrimitive<LazyShortObjectInspector, ShortWritable> {
-
-    public LazyShort(LazyShortObjectInspector oi) {
-        super(oi);
-        data = new ShortWritable();
-    }
-
-    public LazyShort(LazyShort copy) {
-        super(copy);
-        data = new ShortWritable(copy.data.get());
-    }
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        assert (2 == length);
-        data.set(LazyUtils.byteArrayToShort(bytes, start));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyString.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyString.java b/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyString.java
deleted file mode 100644
index 71be572..0000000
--- a/hivesterix/hivesterix-serde/src/main/java/edu/uci/ics/hivesterix/serde/lazy/LazyString.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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.
- */
-/**
- * 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 edu.uci.ics.hivesterix.serde.lazy;
-
-import org.apache.hadoop.io.Text;
-
-import edu.uci.ics.hivesterix.serde.lazy.LazyUtils.VInt;
-import edu.uci.ics.hivesterix.serde.lazy.objectinspector.primitive.LazyStringObjectInspector;
-
-/**
- * LazyObject for storing a value of String.
- */
-public class LazyString extends LazyPrimitive<LazyStringObjectInspector, Text> {
-
-    public LazyString(LazyStringObjectInspector oi) {
-        super(oi);
-        data = new Text();
-    }
-
-    public LazyString(LazyString copy) {
-        super(copy);
-        data = new Text(copy.data);
-    }
-
-    VInt vInt = new LazyUtils.VInt();
-
-    @Override
-    public void init(byte[] bytes, int start, int length) {
-        if (length == 0) {
-            isNull = true;
-            return;
-        } else
-            isNull = false;
-
-        // get the byte length of the string
-        LazyUtils.readVInt(bytes, start, vInt);
-        if (vInt.value + vInt.length != length)
-            throw new IllegalStateException("parse string: length mismatch, expected " + (vInt.value + vInt.length)
-                    + " but get " + length);
-        assert (length - vInt.length > -1);
-        data.set(bytes, start + vInt.length, length - vInt.length);
-    }
-
-}


Mime
View raw message