kadirozde commented on a change in pull request #758: URL: https://github.com/apache/phoenix/pull/758#discussion_r411715628
########## File path: phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java ########## @@ -0,0 +1,161 @@ +/* + * 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.phoenix.coprocessor; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Mutation; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.regionserver.Region; +import org.apache.hadoop.hbase.regionserver.RegionScanner; +import org.apache.hadoop.hbase.regionserver.ScanInfoUtil; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.hbase.index.ValueGetter; +import org.apache.phoenix.hbase.index.covered.update.ColumnReference; +import org.apache.phoenix.hbase.index.parallel.TaskBatch; +import org.apache.phoenix.hbase.index.parallel.TaskRunner; +import org.apache.phoenix.hbase.index.table.HTableFactory; +import org.apache.phoenix.index.IndexMaintainer; +import org.apache.phoenix.mapreduce.index.IndexVerificationResultRepository; + +import java.util.List; +import java.util.Map; + +public abstract class GlobalIndexRegionScanner extends BaseRegionScanner { + + public static final String NUM_CONCURRENT_INDEX_VERIFY_THREADS_CONF_KEY = "index.verify.threads.max"; + public static final int DEFAULT_CONCURRENT_INDEX_VERIFY_THREADS = 17; + public static final String INDEX_VERIFY_ROW_COUNTS_PER_TASK_CONF_KEY = "index.verify.threads.max"; + public static final int DEFAULT_INDEX_VERIFY_ROW_COUNTS_PER_TASK = 2048; + public static final String NO_EXPECTED_MUTATION = "No expected mutation"; + public static final String ACTUAL_MUTATION_IS_NULL_OR_EMPTY = "actualMutationList is null or empty"; + public static final String ERROR_MESSAGE_MISSING_INDEX_ROW_BEYOND_MAX_LOOKBACK = "Missing index row beyond maxLookBack"; + public static final String ERROR_MESSAGE_MISSING_INDEX_ROW = "Missing index row"; + + protected long pageSizeInRows = Long.MAX_VALUE; + protected int rowCountPerTask; + protected boolean hasMore; + protected int maxBatchSize; + protected UngroupedAggregateRegionObserver.MutationList mutations; + protected byte[] indexMetaData; + protected Scan scan; + protected RegionScanner innerScanner; + protected Region region; + protected IndexMaintainer indexMaintainer; + protected Table indexHTable = null; + protected Map<byte[], Put> indexKeyToDataPutMap; + protected TaskRunner pool; + protected TaskBatch<Boolean> tasks; + protected String exceptionMessage; + protected HTableFactory hTableFactory; + protected int indexTableTTL; + protected long maxLookBackInMills; + protected IndexToolVerificationResult verificationResult; + protected IndexVerificationResultRepository verificationResultRepository; + + public GlobalIndexRegionScanner(RegionScanner delegate) { + super(delegate); Review comment: This constructor can initialize the attributes that are defined in this class. This will allow you to remove the common code from the subclass constructors. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
