asterixdb git commit: Fix ASTERIXDB-1776

2017-02-08 Thread imaxon
Repository: asterixdb
Updated Branches:
  refs/heads/master d195de144 -> 4bd3f5899


Fix ASTERIXDB-1776

The source of the issue was a deprecated method that failed when two
IODevices share a common prefix in their absolute path

Change-Id: Iba7837b433ce57f99e2c547e8bd1fb0bfc5a31df
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1489
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
BAD: Jenkins 
Reviewed-by: Yingyi Bu 
Integration-Tests: Jenkins 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/4bd3f589
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/4bd3f589
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/4bd3f589

Branch: refs/heads/master
Commit: 4bd3f5899e52b9a8594d1e649643eccf54ca1272
Parents: d195de1
Author: Ian Maxon 
Authored: Tue Feb 7 18:27:38 2017 -0800
Committer: Ian Maxon 
Committed: Wed Feb 8 16:36:02 2017 -0800

--
 .../hyracks/api/exceptions/ErrorCode.java   |  2 +
 .../src/main/resources/errormsg/en.properties   |  2 +
 .../apache/hyracks/control/nc/io/IOManager.java | 23 +++-
 .../hyracks-storage-common-test/pom.xml |  4 ++
 .../storage/common/IOManagerPathTest.java   | 55 
 5 files changed, 85 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/4bd3f589/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java
 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java
index 963e123..d094368 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java
@@ -47,6 +47,8 @@ public class ErrorCode {
 public static final int NO_SUCH_NODE = 10;
 public static final int CLASS_LOADING_ISSUE = 11;
 public static final int ILLEGAL_WRITE_AFTER_FLUSH_ATTEMPT = 12;
+public static final int DUPLICATE_IODEVICE = 13;
+public static final int NESTED_IODEVICES = 14;
 
 // Compilation error codes.
 public static final int RULECOLLECTION_NOT_INSTANCE_OF_LIST = 10001;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/4bd3f589/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
index 6b74b54..72f7c65 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
+++ 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
@@ -31,5 +31,7 @@
 10 = Node %1$s does not exist
 11 = Class loading issue: %1$s
 12 = Invalid attempt to write to a flushed append only metadata page
+13 = Duplicate IODevices are not allowed
+14 = IODevices should not be nested within each other
 
 1 = The given rule collection %1$s is not an instance of the List class.

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/4bd3f589/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IOManager.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IOManager.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IOManager.java
index 05c9f07..5ccdaa8 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IOManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IOManager.java
@@ -23,6 +23,8 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -62,6 +64,7 @@ public class IOManager implements IIOManager {
 
 public IOManager(List devices) throws HyracksDataException 
{
 this.ioDevices = Collections.unmodifiableList(devices);
+checkDeviceValidity(devices);
 workspaces = new ArrayList<>();
 for (IODeviceHandle d : ioDevices) {
 if (d.getWorkspace() != null) {
@@ -76,6 +79,23 @@ public class IOMana

asterixdb git commit: Fix for ASTERIXDB-1738: Change feed fails to delete record with meta PK

2017-02-08 Thread imaxon
Repository: asterixdb
Updated Branches:
  refs/heads/master ecb045e50 -> d195de144


Fix for ASTERIXDB-1738: Change feed fails to delete record with meta PK

Change-Id: I5ce8d9c69f96593ee305cfad4b44e486c9f1d6cc
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1351
Reviewed-by: abdullah alamoudi 
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
BAD: Jenkins 
Integration-Tests: Jenkins 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/d195de14
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/d195de14
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/d195de14

Branch: refs/heads/master
Commit: d195de1443b0ccf8222770452cced8bcb5c25d5f
Parents: ecb045e
Author: Ildar Absalyamov 
Authored: Tue Dec 6 23:09:20 2016 -0800
Committer: Ildar Absalyamov 
Committed: Mon Feb 6 23:25:33 2017 -0800

--
 asterixdb/asterix-app/pom.xml   |  3 +-
 .../change-feed-with-meta-csv.1.ddl.aql | 61 
 .../change-feed-with-meta-csv.2.update.aql  | 27 +
 .../change-feed-with-meta-csv.3.query.aql   | 30 ++
 .../change-feed-with-meta-csv.4.ddl.aql | 24 
 .../change-feed-with-meta-csv.3.adm |  2 +
 .../src/test/resources/runtimets/testsuite.xml  |  5 ++
 .../external/input/record/CharArrayRecord.java  |  2 +-
 .../src/test/resources/change_feed.csv  |  5 ++
 9 files changed, 157 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d195de14/asterixdb/asterix-app/pom.xml
--
diff --git a/asterixdb/asterix-app/pom.xml b/asterixdb/asterix-app/pom.xml
index 597e328..99e58df 100644
--- a/asterixdb/asterix-app/pom.xml
+++ b/asterixdb/asterix-app/pom.xml
@@ -101,7 +101,7 @@
 
   
   
-copy-beer-csv
+copy-external-data-resources
 generate-resources
 
   copy-resources
@@ -114,6 +114,7 @@
   
../asterix-external-data/src/test/resources
   
 beer.csv
+change_feed.csv
   
 
   

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d195de14/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-csv/change-feed-with-meta-csv.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-csv/change-feed-with-meta-csv.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-csv/change-feed-with-meta-csv.1.ddl.aql
new file mode 100644
index 000..b695a5d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-csv/change-feed-with-meta-csv.1.ddl.aql
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+/*
+ * Description  : Create a dataset with meta part and attempt to load the csv 
file using localFS change feed
+ * Expected Res : Success
+ * Date : 19th Nov 2017
+ */
+ drop dataverse test if exists;
+ create dataverse test;
+ use dataverse test;
+
+ create type TestType as closed {
+ test: string
+ }
+ create type MetaType as {
+ id:int
+ }
+
+ create dataset TestDS(TestType) with meta(MetaType) primary key meta().id;
+ create index TestIdx on TestDS(test);
+ drop feed TestFeed if exists;
+ create feed TestFeed using localfs
+ (
+ ("parser"="record-with-metadata"),
+ ("reader"="localfs"),
+ ("path"="asterix_nc1://target/data/csv/change_feed.csv"),
+ //type of the record
+ ("type-name"="TestType"),
+ //type of the meta record
+ ("meta-type-name"="MetaType"),
+ //format of the record
+ ("record-format"="adm"),
+ // format of the meta record
+ ("format"="csv"),
+ ("delimiter"=","),
+ // index of the primary key the record (meta or orig)
+ ("key

asterixdb git commit: Fix a bug in secondary index entry matter/antimatter reconciliation during upsert

2017-02-08 Thread imaxon
Repository: asterixdb
Updated Branches:
  refs/heads/master 910303b46 -> ecb045e50


Fix a bug in secondary index entry matter/antimatter reconciliation during 
upsert

Change-Id: I5d5c4c44f49308757e05bed3a20475abdd3d38e7
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1488
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
BAD: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: abdullah alamoudi 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/ecb045e5
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/ecb045e5
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/ecb045e5

Branch: refs/heads/master
Commit: ecb045e5005822c1e0fcec6c692d37460ebe2ab7
Parents: 910303b
Author: Ildar Absalyamov 
Authored: Mon Feb 6 16:18:11 2017 -0800
Committer: Ildar Absalyamov 
Committed: Mon Feb 6 20:55:40 2017 -0800

--
 .../operators/LSMSecondaryUpsertOperatorNodePushable.java| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ecb045e5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMSecondaryUpsertOperatorNodePushable.java
--
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMSecondaryUpsertOperatorNodePushable.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMSecondaryUpsertOperatorNodePushable.java
index 1d9ceb4..eab9cc7 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMSecondaryUpsertOperatorNodePushable.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMSecondaryUpsertOperatorNodePushable.java
@@ -63,10 +63,10 @@ public class LSMSecondaryUpsertOperatorNodePushable extends 
LSMIndexInsertUpdate
 }
 
 public static boolean equals(byte[] a, int aOffset, int aLength, byte[] b, 
int bOffset, int bLength) {
-if (a.length != b.length) {
+if (aLength != bLength) {
 return false;
 }
-for (int i = 0; i < a.length; i++) {
+for (int i = 0; i < aLength; i++) {
 if (a[aOffset + i] != b[bOffset + i]) {
 return false;
 }