This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 976e7685db [minor](*): remove redundant log and unused code. (#11620) 976e7685db is described below commit 976e7685dbff7a6f72d6bb036bda4e04163f0d5a Author: jakevin <jakevin...@gmail.com> AuthorDate: Wed Aug 10 19:28:04 2022 +0800 [minor](*): remove redundant log and unused code. (#11620) --- .../org/apache/doris/common/io/OutputBuffer.java | 113 --------------------- .../org/apache/doris/common/AliasGenerator.java | 2 +- .../org/apache/doris/planner/AnalyticEvalNode.java | 8 -- .../transaction/AbortTransactionException.java | 34 ------- .../apache/doris/load/loadv2/etl/SparkEtlJob.java | 6 +- 5 files changed, 4 insertions(+), 159 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/io/OutputBuffer.java b/fe/fe-common/src/main/java/org/apache/doris/common/io/OutputBuffer.java deleted file mode 100644 index f68a2f179e..0000000000 --- a/fe/fe-common/src/main/java/org/apache/doris/common/io/OutputBuffer.java +++ /dev/null @@ -1,113 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.common.io; - -import java.io.ByteArrayOutputStream; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * A reusable {@link OutputStream} implementation that writes to an in-memory - * buffer. - * - * <p> - * This saves memory over creating a new OutputStream and ByteArrayOutputStream - * each time data is written. - * - * <p> - * Typical usage is something like the following: - * - * <pre> - * - * OutputBuffer buffer = new OutputBuffer(); - * while (... loop condition ...) { - * buffer.reset(); - * ... write buffer using OutputStream methods ... - * byte[] data = buffer.getData(); - * int dataLength = buffer.getLength(); - * ... write data to its ultimate destination ... - * } - * </pre> - * - * @see DataOutputBuffer - * @see InputBuffer - */ -public class OutputBuffer extends FilterOutputStream { - - private static class Buffer extends ByteArrayOutputStream { - public byte[] getData() { - return buf; - } - - public int getLength() { - return count; - } - - public void reset() { - count = 0; - } - - public void write(InputStream in, int len) throws IOException { - int newcount = count + len; - if (newcount > buf.length) { - byte[] newbuf = new byte[Math.max(buf.length << 1, newcount)]; - System.arraycopy(buf, 0, newbuf, 0, count); - buf = newbuf; - } - IOUtils.readFully(in, buf, count, len); - count = newcount; - } - } - - private Buffer buffer; - - /** Constructs a new empty buffer. */ - public OutputBuffer() { - this(new Buffer()); - } - - private OutputBuffer(Buffer buffer) { - super(buffer); - this.buffer = buffer; - } - - /** - * Returns the current contents of the buffer. Data is only valid to - * {@link #getLength()}. - */ - public byte[] getData() { - return buffer.getData(); - } - - /** Returns the length of the valid data currently in the buffer. */ - public int getLength() { - return buffer.getLength(); - } - - /** Resets the buffer to empty. */ - public OutputBuffer reset() { - buffer.reset(); - return this; - } - - /** Writes bytes from a InputStream directly into the buffer. */ - public void write(InputStream in, int length) throws IOException { - buffer.write(in, length); - } -} diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/AliasGenerator.java b/fe/fe-core/src/main/java/org/apache/doris/common/AliasGenerator.java index 422a9520ab..cec1078ca7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/AliasGenerator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/AliasGenerator.java @@ -41,7 +41,7 @@ public abstract class AliasGenerator { public String getNextAlias() { Preconditions.checkNotNull(aliasPrefix); while (true) { - String candidateAlias = aliasPrefix + Integer.toString(numGeneratedAliases++); + String candidateAlias = aliasPrefix + (numGeneratedAliases++); if (usedAliases.add(candidateAlias)) { // add success return candidateAlias; diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/AnalyticEvalNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/AnalyticEvalNode.java index 670cc4b288..34462a5fd8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/AnalyticEvalNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AnalyticEvalNode.java @@ -33,7 +33,6 @@ import org.apache.doris.thrift.TAnalyticNode; import org.apache.doris.thrift.TExplainLevel; import org.apache.doris.thrift.TPlanNode; import org.apache.doris.thrift.TPlanNodeType; -import org.apache.doris.thrift.TQueryOptions; import com.google.common.base.Joiner; import com.google.common.base.MoreObjects; @@ -263,11 +262,4 @@ public class AnalyticEvalNode extends PlanNode { return output.toString(); } - - public void computeCosts(TQueryOptions queryOptions) { - Preconditions.checkNotNull(fragmentId, - "PlanNode must be placed into a fragment before calling this method."); - // TODO: come up with estimate based on window - cardinality = 0; - } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/transaction/AbortTransactionException.java b/fe/fe-core/src/main/java/org/apache/doris/transaction/AbortTransactionException.java deleted file mode 100644 index 5ebe92bbd5..0000000000 --- a/fe/fe-core/src/main/java/org/apache/doris/transaction/AbortTransactionException.java +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.transaction; - - -public class AbortTransactionException extends TransactionException { - - public AbortTransactionException(String msg) { - super(msg); - } - - public AbortTransactionException(String msg, Throwable e) { - super(msg, e); - } - - public AbortTransactionException(String msg, long transactionId) { - super(msg, transactionId); - } -} diff --git a/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/etl/SparkEtlJob.java b/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/etl/SparkEtlJob.java index ab558811f5..f3ddc6e011 100644 --- a/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/etl/SparkEtlJob.java +++ b/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/etl/SparkEtlJob.java @@ -90,12 +90,12 @@ public class SparkEtlJob { } private void initConfig() { - LOG.info("job config file path: " + jobConfigFilePath); + LOG.debug("job config file path: " + jobConfigFilePath); Dataset<String> ds = spark.read().textFile(jobConfigFilePath); String jsonConfig = ds.first(); - LOG.info("rdd read json config: " + jsonConfig); + LOG.debug("rdd read json config: " + jsonConfig); etlJobConfig = EtlJobConfig.configFromJson(jsonConfig); - LOG.info("etl job config: " + etlJobConfig); + LOG.debug("etl job config: " + etlJobConfig); } /* --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org