You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by am...@apache.org on 2016/04/04 21:35:30 UTC
incubator-asterixdb git commit: Fix Number of LocalFS Readers
Repository: incubator-asterixdb
Updated Branches:
refs/heads/master 44d6f8a0d -> 08ae069a5
Fix Number of LocalFS Readers
This change makes the number of readers in localfs
adapter always equals to one. This is a temporary
change and is done to avoid sporadic failures for
decorrelation with unique id.
Change-Id: Id948bfd2c1a4e79863378ed98fb27f662fffba93
Reviewed-on: https://asterix-gerrit.ics.uci.edu/782
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <bu...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/08ae069a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/08ae069a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/08ae069a
Branch: refs/heads/master
Commit: 08ae069a5da1a63b60168fb97841fbb7cf172a32
Parents: 44d6f8a
Author: Abdullah Alamoudi <ba...@gmail.com>
Authored: Mon Apr 4 21:57:13 2016 +0300
Committer: abdullah alamoudi <ba...@gmail.com>
Committed: Mon Apr 4 12:29:52 2016 -0700
----------------------------------------------------------------------
.../stream/factory/LocalFSInputStreamFactory.java | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/08ae069a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
----------------------------------------------------------------------
diff --git a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
index 08fce87..712ffbe 100644
--- a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
+++ b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
@@ -22,12 +22,12 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.apache.asterix.common.cluster.ClusterPartition;
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.external.api.AsterixInputStream;
import org.apache.asterix.external.api.IInputStreamFactory;
@@ -38,7 +38,6 @@ import org.apache.asterix.external.util.ExternalDataConstants;
import org.apache.asterix.external.util.ExternalDataUtils;
import org.apache.asterix.external.util.FileSystemWatcher;
import org.apache.asterix.external.util.NodeResolverFactory;
-import org.apache.asterix.om.util.AsterixAppContextInfo;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -128,19 +127,10 @@ public class LocalFSInputStreamFactory implements IInputStreamFactory {
}
private void configurePartitionConstraint() throws AsterixException {
- Map<String, ClusterPartition[]> partitions = AsterixAppContextInfo.getInstance().getMetadataProperties()
- .getNodePartitions();
- List<String> locs = new ArrayList<>();
+ Set<String> locs = new TreeSet<>();
for (int i = 0; i < inputFileSplits.length; i++) {
String location = inputFileSplits[i].getNodeName();
- if (!locs.contains(location)) {
- int numOfPartitions = partitions.get(location).length;
- int j = 0;
- while (j < numOfPartitions) {
- locs.add(location);
- j++;
- }
- }
+ locs.add(location);
}
constraints = new AlgebricksAbsolutePartitionConstraint(locs.toArray(new String[locs.size()]));
}