From 3732a78b3a74692458c7191ee8ae3361b3cceb68 Mon Sep 17 00:00:00 2001 From: tianchen Date: Fri, 19 Jul 2019 12:02:25 +0800 Subject: [PATCH] update javadoc and add unsafe method in BaseIntVector --- .../main/java/org/apache/arrow/vector/BaseIntVector.java | 7 +++++++ .../main/java/org/apache/arrow/vector/BigIntVector.java | 5 +++++ .../src/main/java/org/apache/arrow/vector/IntVector.java | 5 +++++ .../main/java/org/apache/arrow/vector/SmallIntVector.java | 5 +++++ .../main/java/org/apache/arrow/vector/TinyIntVector.java | 5 +++++ .../src/main/java/org/apache/arrow/vector/UInt1Vector.java | 5 +++++ .../src/main/java/org/apache/arrow/vector/UInt2Vector.java | 5 +++++ .../src/main/java/org/apache/arrow/vector/UInt4Vector.java | 5 +++++ .../src/main/java/org/apache/arrow/vector/UInt8Vector.java | 5 +++++ 9 files changed, 47 insertions(+) diff --git a/java/vector/src/main/java/org/apache/arrow/vector/BaseIntVector.java b/java/vector/src/main/java/org/apache/arrow/vector/BaseIntVector.java index 805fb879a8af3..57ad645c87394 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/BaseIntVector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/BaseIntVector.java @@ -24,9 +24,16 @@ public interface BaseIntVector extends ValueVector { /** * Sets the value at index, note this value may need to be need truncated. + * Note this is safe version (i.e. call setSafe method in vector) */ void setWithPossibleTruncate(int index, long value); + /** + * Sets the value at index, note this value may need to be need truncated. + * Note this is unsafe version (i.e. call set method in vector) + */ + void setUnsafeWithPossibleTruncate(int index, long value); + /** * Gets the value at index. * This value may have been extended to long and will throw {@link NullPointerException} diff --git a/java/vector/src/main/java/org/apache/arrow/vector/BigIntVector.java b/java/vector/src/main/java/org/apache/arrow/vector/BigIntVector.java index 4313fc150f3b6..8b9404b7a281c 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/BigIntVector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/BigIntVector.java @@ -327,6 +327,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/IntVector.java b/java/vector/src/main/java/org/apache/arrow/vector/IntVector.java index 6b7fbad4bb5be..61235e0de5224 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/IntVector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/IntVector.java @@ -331,6 +331,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/SmallIntVector.java b/java/vector/src/main/java/org/apache/arrow/vector/SmallIntVector.java index 34a2426f5bcf9..52ecd59b09846 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/SmallIntVector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/SmallIntVector.java @@ -358,6 +358,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/TinyIntVector.java b/java/vector/src/main/java/org/apache/arrow/vector/TinyIntVector.java index 7a8febc37f6dc..ebac2fcec3d87 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/TinyIntVector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/TinyIntVector.java @@ -359,6 +359,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/UInt1Vector.java b/java/vector/src/main/java/org/apache/arrow/vector/UInt1Vector.java index 105acf395c3d5..df3759e7c2d49 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/UInt1Vector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/UInt1Vector.java @@ -322,6 +322,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/UInt2Vector.java b/java/vector/src/main/java/org/apache/arrow/vector/UInt2Vector.java index a9f045a9398c8..e39e5e2646e34 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/UInt2Vector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/UInt2Vector.java @@ -302,6 +302,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/UInt4Vector.java b/java/vector/src/main/java/org/apache/arrow/vector/UInt4Vector.java index 998a2555ae621..8657f067bd657 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/UInt4Vector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/UInt4Vector.java @@ -292,6 +292,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, (int) value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, (int) value); + } + @Override public long getValueAsLong(int index) { return this.get(index); diff --git a/java/vector/src/main/java/org/apache/arrow/vector/UInt8Vector.java b/java/vector/src/main/java/org/apache/arrow/vector/UInt8Vector.java index daf96e7f809e8..62a5ba5e4ab03 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/UInt8Vector.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/UInt8Vector.java @@ -293,6 +293,11 @@ public void setWithPossibleTruncate(int index, long value) { this.setSafe(index, value); } + @Override + public void setUnsafeWithPossibleTruncate(int index, long value) { + this.set(index, value); + } + @Override public long getValueAsLong(int index) { return this.get(index);