Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 62AEC200C41 for ; Thu, 9 Mar 2017 14:31:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 617F0160B67; Thu, 9 Mar 2017 13:31:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92CAB160B64 for ; Thu, 9 Mar 2017 14:31:36 +0100 (CET) Received: (qmail 99298 invoked by uid 500); 9 Mar 2017 13:31:35 -0000 Mailing-List: contact commits-help@carbondata.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.incubator.apache.org Delivered-To: mailing list commits@carbondata.incubator.apache.org Received: (qmail 99278 invoked by uid 99); 9 Mar 2017 13:31:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 13:31:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4DB02C047B for ; Thu, 9 Mar 2017 13:31:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.568 X-Spam-Level: X-Spam-Status: No, score=-3.568 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 5x2l7L5bBij8 for ; Thu, 9 Mar 2017 13:31:30 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 0AEAC5F1EE for ; Thu, 9 Mar 2017 13:31:28 +0000 (UTC) Received: (qmail 99242 invoked by uid 99); 9 Mar 2017 13:31:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 13:31:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 36CABDFF4C; Thu, 9 Mar 2017 13:31:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hexiaoqiao@apache.org To: commits@carbondata.incubator.apache.org Date: Thu, 09 Mar 2017 13:31:28 -0000 Message-Id: <04f26c00be444d49947eb44d5ccbae8c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-carbondata git commit: remove useless classes archived-at: Thu, 09 Mar 2017 13:31:37 -0000 Repository: incubator-carbondata Updated Branches: refs/heads/master 8fef247a9 -> f4f852e78 remove useless classes Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/d246dae2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/d246dae2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/d246dae2 Branch: refs/heads/master Commit: d246dae22554472c336b4507672b915ffcb2eac7 Parents: 8fef247 Author: lucao Authored: Thu Mar 9 13:51:39 2017 +0800 Committer: hexiaoqiao Committed: Thu Mar 9 21:29:14 2017 +0800 ---------------------------------------------------------------------- .../result/iterator/VectorChunkRowIterator.java | 91 ----------- .../vector/impl/CarbonColumnVectorImpl.java | 152 ------------------- 2 files changed, 243 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d246dae2/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java b/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java deleted file mode 100644 index e7461a5..0000000 --- a/core/src/main/java/org/apache/carbondata/core/scan/result/iterator/VectorChunkRowIterator.java +++ /dev/null @@ -1,91 +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.carbondata.core.scan.result.iterator; - -import org.apache.carbondata.common.CarbonIterator; -import org.apache.carbondata.core.scan.result.vector.CarbonColumnarBatch; - -/** - * Iterator over row result - */ -public class VectorChunkRowIterator extends CarbonIterator { - - /** - * iterator over chunk result - */ - private AbstractDetailQueryResultIterator iterator; - - /** - * currect chunk - */ - private CarbonColumnarBatch columnarBatch; - - private int batchSize; - - private int currentIndex; - - public VectorChunkRowIterator(AbstractDetailQueryResultIterator iterator, - CarbonColumnarBatch columnarBatch) { - this.iterator = iterator; - this.columnarBatch = columnarBatch; - if (iterator.hasNext()) { - iterator.processNextBatch(columnarBatch); - batchSize = columnarBatch.getActualSize(); - currentIndex = 0; - } - } - - /** - * Returns {@code true} if the iteration has more elements. (In other words, - * returns {@code true} if {@link #next} would return an element rather than - * throwing an exception.) - * - * @return {@code true} if the iteration has more elements - */ - @Override public boolean hasNext() { - if (currentIndex < batchSize) { - return true; - } else { - while (iterator.hasNext()) { - columnarBatch.reset(); - iterator.processNextBatch(columnarBatch); - batchSize = columnarBatch.getActualSize(); - currentIndex = 0; - if (currentIndex < batchSize) { - return true; - } - } - } - return false; - } - - /** - * Returns the next element in the iteration. - * - * @return the next element in the iteration - */ - @Override public Object[] next() { - Object[] row = new Object[columnarBatch.columnVectors.length]; - for (int i = 0; i < row.length; i++) { - row[i] = columnarBatch.columnVectors[i].getData(currentIndex); - } - currentIndex++; - return row; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d246dae2/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java b/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java deleted file mode 100644 index d7b9221..0000000 --- a/core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java +++ /dev/null @@ -1,152 +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.carbondata.core.scan.result.vector.impl; - -import java.util.Arrays; -import java.util.BitSet; - -import org.apache.carbondata.core.metadata.datatype.DataType; -import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector; - -import org.apache.spark.sql.types.Decimal; -import org.apache.spark.unsafe.types.UTF8String; - -public class CarbonColumnVectorImpl implements CarbonColumnVector { - - private Object[] data; - - private int[] ints; - - private long[] longs; - - private Decimal[] decimals; - - private byte[][] bytes; - - private double[] doubles; - - private BitSet nullBytes; - - private DataType dataType; - - public CarbonColumnVectorImpl(int batchSize, DataType dataType) { - nullBytes = new BitSet(batchSize); - this.dataType = dataType; - switch (dataType) { - case INT: - ints = new int[batchSize]; - break; - case LONG: - longs = new long[batchSize]; - break; - case DOUBLE: - doubles = new double[batchSize]; - break; - case STRING: - bytes = new byte[batchSize][]; - break; - case DECIMAL: - decimals = new Decimal[batchSize]; - break; - default: - data = new Object[batchSize]; - } - } - - @Override public void putShort(int rowId, short value) { - - } - - @Override public void putInt(int rowId, int value) { - ints[rowId] = value; - } - - @Override public void putLong(int rowId, long value) { - longs[rowId] = value; - } - - @Override public void putDecimal(int rowId, Decimal value, int precision) { - decimals[rowId] = value; - } - - @Override public void putDouble(int rowId, double value) { - doubles[rowId] = value; - } - - @Override public void putBytes(int rowId, byte[] value) { - bytes[rowId] = value; - } - - @Override public void putBytes(int rowId, int offset, int length, byte[] value) { - - } - - @Override public void putNull(int rowId) { - nullBytes.set(rowId); - } - - @Override public boolean isNull(int rowId) { - return nullBytes.get(rowId); - } - - @Override public void putObject(int rowId, Object obj) { - data[rowId] = obj; - } - - @Override public Object getData(int rowId) { - if (nullBytes.get(rowId)) { - return null; - } - switch (dataType) { - case INT: - return ints[rowId]; - case LONG: - return longs[rowId]; - case DOUBLE: - return doubles[rowId]; - case STRING: - return UTF8String.fromBytes(bytes[rowId]); - case DECIMAL: - return decimals[rowId]; - default: - return data[rowId]; - } - } - - @Override public void reset() { - nullBytes.clear(); - switch (dataType) { - case INT: - Arrays.fill(ints, 0); - break; - case LONG: - Arrays.fill(longs, 0); - break; - case DOUBLE: - Arrays.fill(doubles, 0); - break; - case STRING: - Arrays.fill(bytes, null); - break; - case DECIMAL: - Arrays.fill(decimals, null); - break; - default: - Arrays.fill(data, null); - } - } -}