Repository: phoenix Updated Branches: refs/heads/3.0 9dd3bc74b -> b4811ad7f
PHOENIX-180 Use stats to guide query parallelization (remove mistakenly checked-in files) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b4811ad7 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b4811ad7 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b4811ad7 Branch: refs/heads/3.0 Commit: b4811ad7f67cfee027692ee27a503898cd75fdcf Parents: 9dd3bc7 Author: maryannxue <maryann...@apache.org> Authored: Thu Sep 25 14:43:55 2014 -0400 Committer: maryannxue <maryann...@apache.org> Committed: Thu Sep 25 14:43:55 2014 -0400 ---------------------------------------------------------------------- .../schema/stat/PTableStatsImpl.java.orig | 68 ------------------ .../schema/stat/PTableStatsImpl.java.rej | 74 -------------------- 2 files changed, 142 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/b4811ad7/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.orig ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.orig b/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.orig deleted file mode 100644 index a6f6dae..0000000 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.orig +++ /dev/null @@ -1,68 +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.phoenix.schema.stat; - -import java.io.DataOutput; -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.io.WritableUtils; - -import com.google.common.collect.ImmutableMap; - - -/** - * Implementation for PTableStats. - */ -public class PTableStatsImpl implements PTableStats { - - // The map for guide posts should be immutable. We only take the current snapshot from outside - // method call and store it. - private Map<String, byte[][]> regionGuidePosts; - - public PTableStatsImpl() { } - - public PTableStatsImpl(Map<String, byte[][]> stats) { - regionGuidePosts = ImmutableMap.copyOf(stats); - } - - @Override - public byte[][] getRegionGuidePosts(HRegionInfo region) { - return regionGuidePosts.get(region.getRegionNameAsString()); - } - - @Override - public void write(DataOutput output) throws IOException { - if (regionGuidePosts == null) { - WritableUtils.writeVInt(output, 0); - return; - } - WritableUtils.writeVInt(output, regionGuidePosts.size()); - for (Entry<String, byte[][]> entry : regionGuidePosts.entrySet()) { - WritableUtils.writeString(output, entry.getKey()); - byte[][] value = entry.getValue(); - WritableUtils.writeVInt(output, value.length); - for (int i=0; i<value.length; i++) { - Bytes.writeByteArray(output, value[i]); - } - } - } -} http://git-wip-us.apache.org/repos/asf/phoenix/blob/b4811ad7/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.rej ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.rej b/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.rej deleted file mode 100644 index 2bfc847..0000000 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStatsImpl.java.rej +++ /dev/null @@ -1,74 +0,0 @@ -*************** -*** 16,55 **** - * limitations under the License. - */ - package org.apache.phoenix.schema.stat; - -- import java.util.Map; -- -- import org.apache.hadoop.hbase.HRegionInfo; -- -- import com.google.common.collect.ImmutableMap; -- -- -- /** - * Implementation for PTableStats. - */ - public class PTableStatsImpl implements PTableStats { - -- // The map for guide posts should be immutable. We only take the current snapshot from outside -- // method call and store it. -- private Map<String, byte[][]> regionGuidePosts; - -- public PTableStatsImpl() { } - -- public PTableStatsImpl(Map<String, byte[][]> stats) { -- regionGuidePosts = ImmutableMap.copyOf(stats); - } - -- @Override -- public byte[][] getRegionGuidePosts(HRegionInfo region) { -- return regionGuidePosts.get(region.getRegionNameAsString()); - } - - @Override -- public Map<String, byte[][]> getGuidePosts(){ -- if(regionGuidePosts != null) { -- return ImmutableMap.copyOf(regionGuidePosts); -- } -- -- return null; - } - } ---- 16,46 ---- - * limitations under the License. - */ - package org.apache.phoenix.schema.stat; -+ import java.util.List; -+ import java.util.TreeMap; - -+ import org.apache.hadoop.hbase.util.Bytes; -+ -+ /** - * Implementation for PTableStats. - */ - public class PTableStatsImpl implements PTableStats { - -+ public static final PTableStats NO_STATS = new PTableStatsImpl(); - -+ private TreeMap<byte[], List<byte[]>> guidePosts = new TreeMap<byte[], List<byte[]>>(Bytes.BYTES_COMPARATOR); - -+ public PTableStatsImpl() { -+ this(new TreeMap<byte[], List<byte[]>>(Bytes.BYTES_COMPARATOR)); - } - -+ public PTableStatsImpl(TreeMap<byte[], List<byte[]>> guidePosts) { -+ this.guidePosts = guidePosts; - } - - @Override -+ public TreeMap<byte[], List<byte[]>> getGuidePosts() { -+ return guidePosts; - } -+ - }