You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2021/09/03 01:24:15 UTC
[orc] branch branch-1.7 updated: ORC-981: Add `CommentsIndentation`
checkstyle rule (#894)
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new dadf74a ORC-981: Add `CommentsIndentation` checkstyle rule (#894)
dadf74a is described below
commit dadf74a3a27eca8850026f633d96e7b9f042adf4
Author: William Hyun <wi...@apache.org>
AuthorDate: Thu Sep 2 18:23:13 2021 -0700
ORC-981: Add `CommentsIndentation` checkstyle rule (#894)
### What changes were proposed in this pull request?
This PR aims to add the `CommentsIndentation` checkstyle rule
### Why are the changes needed?
This will fix misaligned comments and enforce it.
### How was this patch tested?
Pass the CIs.
(cherry picked from commit 5ae64d794dcef613950f40d2aa2b61b295f72875)
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
.../src/java/org/apache/orc/InMemoryKeystore.java | 30 +++++++++++-----------
java/core/src/java/org/apache/orc/OrcFile.java | 10 ++++----
.../apache/orc/impl/ConvertTreeReaderFactory.java | 4 +--
.../src/java/org/apache/orc/impl/InStream.java | 8 +++---
.../java/org/apache/orc/impl/IntegerReader.java | 8 +++---
.../org/apache/orc/impl/writer/CharTreeWriter.java | 2 +-
java/pom.xml | 1 +
7 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/java/core/src/java/org/apache/orc/InMemoryKeystore.java b/java/core/src/java/org/apache/orc/InMemoryKeystore.java
index 89537c9..dc281a7 100644
--- a/java/core/src/java/org/apache/orc/InMemoryKeystore.java
+++ b/java/core/src/java/org/apache/orc/InMemoryKeystore.java
@@ -254,21 +254,21 @@ public class InMemoryKeystore implements KeyProvider {
return addKey(keyName, 0, algorithm, masterKey);
}
- /**
- * Function that takes care of adding a new key.<br>
- * A new key can be added only if:
- * <ul>
- * <li>This is a new key and no prior key version exist.</li>
- * <li>If the key exists (has versions), then the new version to be added should be greater than
- * the version that already exists.</li>
- * </ul>
- *
- * @param keyName Name of the key to be added
- * @param version Key Version
- * @param algorithm Algorithm used
- * @param masterKey Master key
- * @return this
- */
+ /**
+ * Function that takes care of adding a new key.<br>
+ * A new key can be added only if:
+ * <ul>
+ * <li>This is a new key and no prior key version exist.</li>
+ * <li>If the key exists (has versions), then the new version to be added should be greater than
+ * the version that already exists.</li>
+ * </ul>
+ *
+ * @param keyName Name of the key to be added
+ * @param version Key Version
+ * @param algorithm Algorithm used
+ * @param masterKey Master key
+ * @return this
+ */
public InMemoryKeystore addKey(String keyName, int version,
EncryptionAlgorithm algorithm,
byte[] masterKey) throws IOException {
diff --git a/java/core/src/java/org/apache/orc/OrcFile.java b/java/core/src/java/org/apache/orc/OrcFile.java
index 9c14dee..82d8828 100644
--- a/java/core/src/java/org/apache/orc/OrcFile.java
+++ b/java/core/src/java/org/apache/orc/OrcFile.java
@@ -164,11 +164,11 @@ public class OrcFile {
public enum WriterVersion {
// Java ORC Writer
ORIGINAL(WriterImplementation.ORC_JAVA, 0),
- HIVE_8732(WriterImplementation.ORC_JAVA, 1), // fixed stripe/file maximum
- // statistics & string statistics
- // use utf8 for min/max
- HIVE_4243(WriterImplementation.ORC_JAVA, 2), // use real column names from
- // Hive tables
+ HIVE_8732(WriterImplementation.ORC_JAVA, 1), /**
+ * fixed stripe/file maximum statistics and
+ * string statistics to use utf8 for min/max
+ */
+ HIVE_4243(WriterImplementation.ORC_JAVA, 2), // use real column names from Hive tables
HIVE_12055(WriterImplementation.ORC_JAVA, 3), // vectorized writer
HIVE_13083(WriterImplementation.ORC_JAVA, 4), // decimals write present stream correctly
ORC_101(WriterImplementation.ORC_JAVA, 5), // bloom filters use utf8
diff --git a/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java b/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
index af20aa2..7ead469 100644
--- a/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
+++ b/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
@@ -263,7 +263,7 @@ public class ConvertTreeReaderFactory extends TreeReaderFactory {
@Override
public void seek(PositionProvider[] index, ReadPhase readPhase) throws IOException {
- // Pass-thru.
+ // Pass-thru.
fromReader.seek(index, readPhase);
}
@@ -2407,7 +2407,7 @@ public class ConvertTreeReaderFactory extends TreeReaderFactory {
case VARCHAR:
switch (readerType.getCategory()) {
// Not currently supported conversion(s):
- // (None)
+ // (None)
default:
return true;
}
diff --git a/java/core/src/java/org/apache/orc/impl/InStream.java b/java/core/src/java/org/apache/orc/impl/InStream.java
index 06fd6ab..e6da6d4 100644
--- a/java/core/src/java/org/apache/orc/impl/InStream.java
+++ b/java/core/src/java/org/apache/orc/impl/InStream.java
@@ -68,10 +68,10 @@ public abstract class InStream extends InputStream {
*/
protected abstract void setCurrent(DiskRangeList newRange,
boolean isJump);
- /**
- * Reset the input to a new set of data.
- * @param input the input data
- */
+ /**
+ * Reset the input to a new set of data.
+ * @param input the input data
+ */
protected void reset(DiskRangeList input) {
bytes = input;
while (input != null &&
diff --git a/java/core/src/java/org/apache/orc/impl/IntegerReader.java b/java/core/src/java/org/apache/orc/impl/IntegerReader.java
index 980b573..39ec7cd 100644
--- a/java/core/src/java/org/apache/orc/impl/IntegerReader.java
+++ b/java/core/src/java/org/apache/orc/impl/IntegerReader.java
@@ -62,10 +62,10 @@ public interface IntegerReader {
* @param length the number of numbers to read
* @throws IOException
*/
- void nextVector(ColumnVector column,
- long[] data,
- int length
- ) throws IOException;
+ void nextVector(ColumnVector column,
+ long[] data,
+ int length
+ ) throws IOException;
/**
* Return the next available vector for values. Does not change the
diff --git a/java/core/src/java/org/apache/orc/impl/writer/CharTreeWriter.java b/java/core/src/java/org/apache/orc/impl/writer/CharTreeWriter.java
index 83a72e9..8e2a287 100644
--- a/java/core/src/java/org/apache/orc/impl/writer/CharTreeWriter.java
+++ b/java/core/src/java/org/apache/orc/impl/writer/CharTreeWriter.java
@@ -57,7 +57,7 @@ public class CharTreeWriter extends StringBaseTreeWriter {
for(int i=0; i < length; ++i) {
if (vec.noNulls || !vec.isNull[i + offset]) {
// offset + i, once per loop
- writePadded(vec, i + offset, 1);
+ writePadded(vec, i + offset, 1);
}
}
}
diff --git a/java/pom.xml b/java/pom.xml
index 040499c..53bca8c 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -295,6 +295,7 @@
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
+ <module name="CommentsIndentation"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<!-- https://checkstyle.sourceforge.io/config_imports.html#ImportOrder IntelliJ default example -->