ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [3/7] ignite git commit: IGNITE-1814: Removed unused primitives.
Date Mon, 02 Nov 2015 12:02:00 GMT
IGNITE-1814: Removed unused primitives.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4a170d35
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4a170d35
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4a170d35

Branch: refs/heads/ignite-1814
Commit: 4a170d35f70729e56960ca2b2f6da713ed0e03bf
Parents: 2c7b61e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Nov 2 13:04:16 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Nov 2 13:04:16 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/PortablePrimitives.java   | 377 -------------------
 1 file changed, 377 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4a170d35/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePrimitives.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePrimitives.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePrimitives.java
index 4c6b5fe..9bd1b7b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePrimitives.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePrimitives.java
@@ -153,115 +153,10 @@ public abstract class PortablePrimitives {
     /**
      * @param arr Array.
      * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeByteArray(byte[] arr, int off, byte[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract byte[] readByteArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeShortArray(byte[] arr, int off, short[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract short[] readShortArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeIntArray(byte[] arr, int off, int[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract int[] readIntArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeLongArray(byte[] arr, int off, long[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract long[] readLongArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeFloatArray(byte[] arr, int off, float[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract float[] readFloatArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeDoubleArray(byte[] arr, int off, double[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract double[] readDoubleArray(byte[] arr, int off, int len);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeCharArray(byte[] arr, int off, char[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
      * @return Value.
      */
     public abstract char[] readCharArray(byte[] arr, int off, int len);
 
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public abstract void writeBooleanArray(byte[] arr, int off, boolean[] val);
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public abstract boolean[] readBooleanArray(byte[] arr, int off, int len);
-
     /** */
     private static class UnsafePrimitives extends PortablePrimitives {
         /** */
@@ -271,26 +166,8 @@ public abstract class PortablePrimitives {
         private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
 
         /** */
-        private static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
-
-        /** */
-        private static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
-
-        /** */
-        private static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
-
-        /** */
-        private static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
-
-        /** */
-        private static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
-
-        /** */
         private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
 
-        /** */
-        private static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
-
         /** {@inheritDoc} */
         @Override public void writeByte(byte[] arr, int off, byte val) {
             UNSAFE.putByte(arr, BYTE_ARR_OFF + off, val);
@@ -372,95 +249,6 @@ public abstract class PortablePrimitives {
         }
 
         /** {@inheritDoc} */
-        @Override public void writeByteArray(byte[] arr, int off, byte[] val) {
-            UNSAFE.copyMemory(val, BYTE_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length);
-        }
-
-        /** {@inheritDoc} */
-        @Override public byte[] readByteArray(byte[] arr, int off, int len) {
-            byte[] arr0 = new byte[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, BYTE_ARR_OFF, len);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeShortArray(byte[] arr, int off, short[] val) {
-            UNSAFE.copyMemory(val, SHORT_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
1);
-        }
-
-        /** {@inheritDoc} */
-        @Override public short[] readShortArray(byte[] arr, int off, int len) {
-            short[] arr0 = new short[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, SHORT_ARR_OFF, len <<
1);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeIntArray(byte[] arr, int off, int[] val) {
-            UNSAFE.copyMemory(val, INT_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
2);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int[] readIntArray(byte[] arr, int off, int len) {
-            int[] arr0 = new int[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, INT_ARR_OFF, len << 2);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeLongArray(byte[] arr, int off, long[] val) {
-            UNSAFE.copyMemory(val, LONG_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
3);
-        }
-
-        /** {@inheritDoc} */
-        @Override public long[] readLongArray(byte[] arr, int off, int len) {
-            long[] arr0 = new long[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, LONG_ARR_OFF, len << 3);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeFloatArray(byte[] arr, int off, float[] val) {
-            UNSAFE.copyMemory(val, FLOAT_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
2);
-        }
-
-        /** {@inheritDoc} */
-        @Override public float[] readFloatArray(byte[] arr, int off, int len) {
-            float[] arr0 = new float[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, FLOAT_ARR_OFF, len <<
2);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeDoubleArray(byte[] arr, int off, double[] val) {
-            UNSAFE.copyMemory(val, DOUBLE_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
3);
-        }
-
-        /** {@inheritDoc} */
-        @Override public double[] readDoubleArray(byte[] arr, int off, int len) {
-            double[] arr0 = new double[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, DOUBLE_ARR_OFF, len <<
3);
-
-            return arr0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeCharArray(byte[] arr, int off, char[] val) {
-            UNSAFE.copyMemory(val, CHAR_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length <<
1);
-        }
-
-        /** {@inheritDoc} */
         @Override public char[] readCharArray(byte[] arr, int off, int len) {
             char[] arr0 = new char[len];
 
@@ -468,20 +256,6 @@ public abstract class PortablePrimitives {
 
             return arr0;
         }
-
-        /** {@inheritDoc} */
-        @Override public void writeBooleanArray(byte[] arr, int off, boolean[] val) {
-            UNSAFE.copyMemory(val, BOOLEAN_ARR_OFF, arr, BYTE_ARR_OFF + off, val.length);
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean[] readBooleanArray(byte[] arr, int off, int len) {
-            boolean[] arr0 = new boolean[len];
-
-            UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, BOOLEAN_ARR_OFF, len);
-
-            return arr0;
-        }
     }
 
     /** */
@@ -607,141 +381,6 @@ public abstract class PortablePrimitives {
         }
 
         /** {@inheritDoc} */
-        @Override public void writeByteArray(byte[] arr, int off, byte[] val) {
-            for (byte b : val)
-                arr[off++] = b;
-        }
-
-        /** {@inheritDoc} */
-        @Override public byte[] readByteArray(byte[] arr, int off, int len) {
-            byte[] val = new byte[len];
-
-            for (int i = 0; i < len; i++)
-                val[i] = arr[off++];
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeShortArray(byte[] arr, int off, short[] val) {
-            for (short s : val) {
-                writeShort(arr, off, s);
-
-                off += 2;
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public short[] readShortArray(byte[] arr, int off, int len) {
-            short[] val = new short[len];
-
-            for (int i = 0; i < len; i++) {
-                val[i] = readShort(arr, off);
-
-                off += 2;
-            }
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeIntArray(byte[] arr, int off, int[] val) {
-            for (int i : val) {
-                writeInt(arr, off, i);
-
-                off += 4;
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public int[] readIntArray(byte[] arr, int off, int len) {
-            int[] val = new int[len];
-
-            for (int i = 0; i < len; i++) {
-                val[i] = readInt(arr, off);
-
-                off += 4;
-            }
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeLongArray(byte[] arr, int off, long[] val) {
-            for (long l : val) {
-                writeLong(arr, off, l);
-
-                off += 8;
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public long[] readLongArray(byte[] arr, int off, int len) {
-            long[] val = new long[len];
-
-            for (int i = 0; i < len; i++) {
-                val[i] = readLong(arr, off);
-
-                off += 8;
-            }
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeFloatArray(byte[] arr, int off, float[] val) {
-            for (float f : val) {
-                writeFloat(arr, off, f);
-
-                off += 4;
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public float[] readFloatArray(byte[] arr, int off, int len) {
-            float[] val = new float[len];
-
-            for (int i = 0; i < len; i++) {
-                val[i] = readFloat(arr, off);
-
-                off += 4;
-            }
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeDoubleArray(byte[] arr, int off, double[] val) {
-            for (double d : val) {
-                writeDouble(arr, off, d);
-
-                off += 8;
-            }
-        }
-
-        /** {@inheritDoc} */
-        @Override public double[] readDoubleArray(byte[] arr, int off, int len) {
-            double[] val = new double[len];
-
-            for (int i = 0; i < len; i++) {
-                val[i] = readDouble(arr, off);
-
-                off += 8;
-            }
-
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeCharArray(byte[] arr, int off, char[] val) {
-            for (char c : val) {
-                writeChar(arr, off, c);
-
-                off += 2;
-            }
-        }
-
-        /** {@inheritDoc} */
         @Override public char[] readCharArray(byte[] arr, int off, int len) {
             char[] val = new char[len];
 
@@ -753,21 +392,5 @@ public abstract class PortablePrimitives {
 
             return val;
         }
-
-        /** {@inheritDoc} */
-        @Override public void writeBooleanArray(byte[] arr, int off, boolean[] val) {
-            for (boolean b : val)
-                writeBoolean(arr, off++, b);
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean[] readBooleanArray(byte[] arr, int off, int len) {
-            boolean[] val = new boolean[len];
-
-            for (int i = 0; i < len; i++)
-                val[i] = readBoolean(arr, off++);
-
-            return val;
-        }
     }
 }
\ No newline at end of file


Mime
View raw message