Github user jackylk commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/265#discussion_r90245110 --- Diff: core/src/main/java/org/apache/carbondata/core/carbon/datastore/chunk/reader/CarbonDataReaderFactory.java --- @@ -0,0 +1,93 @@ +/* + * 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.carbon.datastore.chunk.reader; + +import org.apache.carbondata.core.carbon.datastore.chunk.reader.dimension.CompressedDimensionChunkFileBasedReader; +import org.apache.carbondata.core.carbon.datastore.chunk.reader.dimension.CompressedDimensionChunkFileBasedReader2; +import org.apache.carbondata.core.carbon.datastore.chunk.reader.measure.CompressedMeasureChunkFileBasedReader; +import org.apache.carbondata.core.carbon.datastore.chunk.reader.measure.CompressedMeasureChunkFileReader2; +import org.apache.carbondata.core.carbon.metadata.blocklet.BlockletInfo; + +/** + * Factory class to get the data reader instance based on version + */ +public class CarbonDataReaderFactory { + + /** + * static instance + */ + private static final CarbonDataReaderFactory CARBON_DATA_READER_FACTORY = + new CarbonDataReaderFactory(); + + /** + * private constructor + */ + private CarbonDataReaderFactory() { + + } + + /** + * To get the instance of the reader factor + * + * @return reader factory + */ + public static CarbonDataReaderFactory getInstance() { + return CARBON_DATA_READER_FACTORY; + } + + /** + * Below method will be used to get the dimension column chunk reader based on version number + * + * @param version reader version + * @param blockletInfo blocklet info + * @param eachColumnValueSize size of each dimension column + * @param filePath carbon data file path + * @return dimension column data reader based on version number + */ + public DimensionColumnChunkReader getDimensionColumnChunkReader(short version, + BlockletInfo blockletInfo, int[] eachColumnValueSize, String filePath) { + switch (version) { + case 2: --- End diff -- should have enum for version --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
Free forum by Nabble | Edit this page |