[12/16] asterixdb git commit: [NO ISSUE][LOG] Include destination IP in thread name on push back

2018-08-31 Thread mblow
[NO ISSUE][LOG] Include destination IP in thread name on push back

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- In certain cases, we noticed that threads of certain jobs are
  waiting on the network boundaries to send tuples.
- In that case and in a big cluster, it is difficult to tell which
  node is pushing back.
- To make this easy, we include the IP of the receiving node
  in the thread name.

Change-Id: I81b48cb7a79de0a37f2171a1bd3b82141f89b49d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2929
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Contrib: Jenkins 
Reviewed-by: Murtadha Hubail 
Integration-Tests: Jenkins 
(cherry picked from commit 2498d28f0584d6ab002625417622be429f5c8131)
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2942


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

Branch: refs/heads/master
Commit: af750b65e094cfb855488a97b60e2f1c2d687b5b
Parents: ecbb73f
Author: Abdullah Alamoudi 
Authored: Mon Aug 27 13:42:21 2018 -0700
Committer: abdullah alamoudi 
Committed: Fri Aug 31 00:05:37 2018 -0700

--
 .../hyracks/comm/channels/NetworkOutputChannel.java | 12 +++-
 .../net/protocols/muxdemux/ChannelControlBlock.java |  5 +
 .../hyracks/net/protocols/muxdemux/ChannelSet.java  |  4 
 .../net/protocols/muxdemux/MultiplexedConnection.java   |  5 +
 4 files changed, 25 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af750b65/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
 
b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
index 334fb5c..261e7c4 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
@@ -18,9 +18,11 @@
  */
 package org.apache.hyracks.comm.channels;
 
+import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.ArrayDeque;
 import java.util.Deque;
+import java.util.Objects;
 
 import org.apache.hyracks.api.comm.IBufferAcceptor;
 import org.apache.hyracks.api.comm.IFrameWriter;
@@ -75,7 +77,15 @@ public class NetworkOutputChannel implements IFrameWriter {
 break;
 }
 try {
-wait();
+InetSocketAddress remoteAddress = 
ccb.getRemoteAddress();
+String nameBefore = Thread.currentThread().getName();
+try {
+Thread.currentThread()
+.setName(nameBefore + ":SendingTo(" + 
Objects.toString(remoteAddress) + ")");
+wait();
+} finally {
+Thread.currentThread().setName(nameBefore);
+}
 } catch (InterruptedException e) {
 Thread.currentThread().interrupt();
 throw HyracksDataException.create(e);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af750b65/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
index 998acfb..f7ef2aa 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
@@ -19,6 +19,7 @@
 package org.apache.hyracks.net.protocols.muxdemux;
 
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.nio.channels.SocketChannel;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -163,4 +164,8 @@ public class ChannelControlBlock implements 
IChannelControlBlock {
 + " remoteClose: " + remoteClose + " remoteCloseAck:" + 
remoteCloseAck + " readCredits: "
 + 

[07/16] asterixdb git commit: [ASTERIXDB-2448][COMP] Fix NullPointerException in IntroduceSelectAccessMethodRule

2018-08-31 Thread mblow
[ASTERIXDB-2448][COMP] Fix NullPointerException in 
IntroduceSelectAccessMethodRule

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fixed NPE when intersecting two indexes and predicate containing
  between operator:
  a) If index intersection plan is not possible then exit the rule
  b) Rewrite between operator into ge/le pair instead of le/le pair

Change-Id: I34d4cde6adf3785feb6a8280fcdb964a5fb72803
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2937
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


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

Branch: refs/heads/master
Commit: a952e0150efd60d584761af6d8619f15766dab08
Parents: bdb1cb4
Author: Dmitry Lychagin 
Authored: Wed Aug 29 20:58:59 2018 -0700
Committer: Dmitry Lychagin 
Committed: Thu Aug 30 09:43:06 2018 -0700

--
 .../am/IntroduceSelectAccessMethodRule.java | 18 ---
 .../btree-index/btree-secondary-68.sqlpp| 54 
 .../results/btree-index/btree-secondary-68.plan | 32 
 .../intersection-with-between.1.ddl.sqlpp   | 43 
 .../intersection-with-between.2.update.sqlpp| 23 +
 .../intersection-with-between.3.ddl.sqlpp   | 24 +
 .../intersection-with-between.4.query.sqlpp | 26 ++
 .../intersection-with-between.4.adm |  7 +++
 .../push-limit-to-primary-scan-select.8.adm |  2 +-
 .../resources/runtimets/testsuite_sqlpp.xml |  5 ++
 .../visitor/OperatorExpressionVisitor.java  | 16 +++---
 11 files changed, 234 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/a952e015/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
--
diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
index d2b456f..0ea16ae 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
@@ -220,13 +220,17 @@ public class IntroduceSelectAccessMethodRule extends 
AbstractIntroduceAccessMeth
 List subRoots = new ArrayList<>();
 for (Pair pair : chosenIndexes) {
 AccessMethodAnalysisContext analysisCtx = 
analyzedAMs.get(pair.first);
-subRoots.add(pair.first.createIndexSearchPlan(afterSelectRefs, 
selectRef, conditionRef,
-subTree.getAssignsAndUnnestsRefs(), subTree, null, 
pair.second, analysisCtx,
-
AccessMethodUtils.retainInputs(subTree.getDataSourceVariables(),
-subTree.getDataSourceRef().getValue(), 
afterSelectRefs),
-false, 
subTree.getDataSourceRef().getValue().getInputs().get(0).getValue()
-.getExecutionMode() == ExecutionMode.UNPARTITIONED,
-context, null));
+boolean retainInput = 
AccessMethodUtils.retainInputs(subTree.getDataSourceVariables(),
+subTree.getDataSourceRef().getValue(), afterSelectRefs);
+boolean requiresBroadcast = 
subTree.getDataSourceRef().getValue().getInputs().get(0).getValue()
+.getExecutionMode() == ExecutionMode.UNPARTITIONED;
+ILogicalOperator subRoot = 
pair.first.createIndexSearchPlan(afterSelectRefs, selectRef, conditionRef,
+subTree.getAssignsAndUnnestsRefs(), subTree, null, 
pair.second, analysisCtx, retainInput, false,
+requiresBroadcast, context, null);
+if (subRoot == null) {
+return false;
+}
+subRoots.add(subRoot);
 }
 // Connect each secondary index utilization plan to a common intersect 
operator.
 ILogicalOperator primaryUnnestOp = 
connectAll2ndarySearchPlanWithIntersect(subRoots, context);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/a952e015/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-68.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-68.sqlpp
 

[05/16] asterixdb git commit: [ASTERIXDB-2444][STO] Avoid Using System Clock in Storage

2018-08-31 Thread mblow
[ASTERIXDB-2444][STO] Avoid Using System Clock in Storage

- user model changes: no
- storage format changes: yes
- interface changes: yes

Details:
- Replace the usage of system clock timestamps in LSM
  index components file names by a sequencer. The next
  sequence id to use is determined by checking the list
  of existing components on disk. Note that due to a
  rollback, an index checkpoint file may have last valid
  component sequence which is greater than what is on disk.
  This should not cause any issues since only components
  that have a sequence greater than that appears in the
  checkpoint will be deleted.
- Replace the usage of system clock timestamps in LSM
  index components ids by a monotonically increasing
  sequencer. The sequencer is initialized after restarts
  by the last valid component id that appears in the
  index checkpoint.
- Refactor the logic to generate flush/merge file names.
- Refactor the logic to check invalid components.
- Adapt test cases to new naming format.

Change-Id: I9dff8ffb38ce8064a199d03b070ed1f5b924b8a4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2927
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Murtadha Hubail 
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/865a2ed0
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/865a2ed0
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/865a2ed0

Branch: refs/heads/master
Commit: 865a2ed0b594802c8ad93acf26e533b9377b3a47
Parents: c410e83
Author: Murtadha Hubail 
Authored: Tue Aug 28 15:38:22 2018 +0300
Committer: Murtadha Hubail 
Committed: Tue Aug 28 15:42:50 2018 -0700

--
 .../asterix/app/nc/IndexCheckpointManager.java  |  34 ++--
 .../dataflow/TestLsmIoOpCallbackFactory.java|  10 +-
 .../PersistentLocalResourceRepositoryTest.java  |  25 +--
 .../common/context/DatasetLifecycleManager.java |  24 +++
 .../ioopcallbacks/LSMIOOperationCallback.java   |  18 ++-
 .../LSMIndexIOOperationCallbackFactory.java |   4 +-
 .../common/storage/IIndexCheckpointManager.java |  28 ++--
 .../asterix/common/storage/IndexCheckpoint.java |  14 +-
 .../LSMIOOperationCallbackTest.java |  39 +++--
 .../CheckpointPartitionIndexesTask.java |  12 +-
 .../messaging/ComponentMaskTask.java|   4 +-
 .../messaging/MarkComponentValidTask.java   |  14 +-
 .../messaging/ReplicateFileTask.java|   2 +-
 .../PersistentLocalResourceRepository.java  |  51 ++
 .../am/lsm/btree/impls/LSMBTreeFileManager.java |  77 -
 .../impls/LSMBTreeWithBuddyFileManager.java | 100 +---
 .../common/api/ILSMComponentIdGenerator.java|   6 +
 .../impls/AbstractLSMIndexFileManager.java  | 160 +--
 .../impls/IndexComponentFileReference.java  | 131 +++
 .../am/lsm/common/impls/LSMComponentId.java |   4 +-
 .../common/impls/LSMComponentIdGenerator.java   |  45 +++---
 .../impls/LSMInvertedIndexFileManager.java  |  97 +--
 .../am/lsm/rtree/impls/LSMRTreeFileManager.java |  99 +---
 .../component/TestLsmIndexFileManager.java  |  17 +-
 24 files changed, 517 insertions(+), 498 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/865a2ed0/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
--
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
index 64d8e93..3c62d99 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
@@ -30,7 +30,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Optional;
 
 import org.apache.asterix.common.storage.IIndexCheckpointManager;
 import org.apache.asterix.common.storage.IndexCheckpoint;
@@ -56,7 +55,7 @@ public class IndexCheckpointManager implements 
IIndexCheckpointManager {
 }
 
 @Override
-public synchronized void init(String lastComponentTimestamp, long lsn) 
throws HyracksDataException {
+public synchronized void init(long validComponentSequence, long lsn) 
throws HyracksDataException {
 List checkpoints;
 try {
 checkpoints = getCheckpoints();
@@ -67,25 +66,24 @@ public class IndexCheckpointManager implements 
IIndexCheckpointManager {
 LOGGER.warn(() -> "Checkpoints found on initializing: " + 
indexPath);
 delete();
 }
-

[14/16] asterixdb git commit: [ASTERIXDB-2449][FUN] Incorrect NULL/MISSING handling by concat functions

2018-08-31 Thread mblow
[ASTERIXDB-2449][FUN] Incorrect NULL/MISSING handling by concat functions

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Infer function return type as unknownable if
  its input list item can be NULL/MISSING
- Always return MISSING if there is a MISSING argument

Change-Id: Idc364b061f3e74bdc9d7715bbadedc957e9e8223
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2946
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


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

Branch: refs/heads/master
Commit: bcc93471dfcf6cb2947376fec7336684efd91a8b
Parents: 059ab96
Author: Dmitry Lychagin 
Authored: Thu Aug 30 19:30:39 2018 -0700
Committer: Dmitry Lychagin 
Committed: Fri Aug 31 10:15:40 2018 -0700

--
 .../binary/concat2/concat2.1.query.sqlpp| 25 
 .../string-concat2/string-concat2.1.query.sqlpp | 25 
 .../string-concat2/string-concat2.2.query.sqlpp | 25 
 .../results/binary/concat2/concat2.1.adm|  1 +
 .../string/string-concat2/string-concat2.1.adm  |  1 +
 .../string/string-concat2/string-concat2.2.adm  |  1 +
 .../resources/runtimets/testsuite_sqlpp.xml | 10 +++
 .../asterix/om/functions/BuiltinFunctions.java  |  5 +-
 .../typecomputer/impl/ConcatTypeComputer.java   | 64 
 .../functions/StringConcatDescriptor.java   | 11 +++-
 .../binary/BinaryConcatDescriptor.java  | 27 -
 11 files changed, 175 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bcc93471/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/binary/concat2/concat2.1.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/binary/concat2/concat2.1.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/binary/concat2/concat2.1.query.sqlpp
new file mode 100644
index 000..782cce2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/binary/concat2/concat2.1.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+{
+  't1': binary_concat([null,hex('aa')]),
+  't2': binary_concat([hex('aa'),null]),
+  't3': binary_concat([null,missing,hex('aa')]),
+  't4': binary_concat([hex('aa'),null,missing])
+};

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bcc93471/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/string-concat2/string-concat2.1.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/string-concat2/string-concat2.1.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/string-concat2/string-concat2.1.query.sqlpp
new file mode 100644
index 000..3e48631
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/string-concat2/string-concat2.1.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 

[13/16] asterixdb git commit: [NO ISSUE][STO] Ensure First Component ID is Initialized

2018-08-31 Thread mblow
[NO ISSUE][STO] Ensure First Component ID is Initialized

- user model changes: no
- storage format changes: no
- interface changes: yes

Details:
- Initialize the component id generator from the primary
  index checkpoint, if exits, as soon as it is created.
- Ensure the first component id is passed to all indexes.

Change-Id: I246f9373f950e2f9a2c63f86746462e42a3f1c62
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2948
Reviewed-by: abdullah alamoudi 
Tested-by: 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/059ab964
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/059ab964
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/059ab964

Branch: refs/heads/master
Commit: 059ab9647450a64ee4a2b7def471b1a1729e8633
Parents: af750b6
Author: Murtadha Hubail 
Authored: Fri Aug 31 10:21:51 2018 +0300
Committer: Murtadha Hubail 
Committed: Fri Aug 31 05:37:54 2018 -0700

--
 .../apache/asterix/app/nc/RecoveryManager.java  |  4 +-
 .../test/dataflow/ComponentRollbackTest.java| 34 --
 .../dataflow/TestLsmIoOpCallbackFactory.java|  2 +-
 ...TestPrimaryIndexOperationTrackerFactory.java |  5 +-
 .../common/api/IDatasetLifecycleManager.java| 15 +-
 .../DatasetLSMComponentIdGeneratorFactory.java  |  2 +-
 .../common/context/DatasetLifecycleManager.java | 49 +---
 .../ioopcallbacks/LSMIOOperationCallback.java   | 11 ++---
 .../LSMIndexIOOperationCallbackFactory.java |  4 +-
 .../common/storage/ResourceReference.java   |  9 
 .../LSMIOOperationCallbackTest.java | 25 +-
 .../PrimaryIndexOperationTrackerFactory.java|  2 +-
 .../common/api/ILSMComponentIdGenerator.java|  7 ---
 .../common/impls/LSMComponentIdGenerator.java   | 14 +-
 14 files changed, 88 insertions(+), 95 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/059ab964/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
--
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
index adf9960..946815f 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
@@ -300,7 +300,6 @@ public class RecoveryManager implements IRecoveryManager, 
ILifeCycleComponent {
 TxnEntityId tempKeyTxnEntityId = new TxnEntityId(-1, -1, -1, null, -1, 
false);
 
 ILogRecord logRecord = null;
-ILSMComponentIdGenerator idGenerator = null;
 try {
 logReader.setPosition(lowWaterMarkLSN);
 logRecord = logReader.next();
@@ -389,8 +388,7 @@ public class RecoveryManager implements IRecoveryManager, 
ILifeCycleComponent {
 int partition = logRecord.getResourcePartition();
 if (partitions.contains(partition)) {
 int datasetId = logRecord.getDatasetId();
-idGenerator = 
datasetLifecycleManager.getComponentIdGenerator(datasetId, partition);
-if (idGenerator == null) {
+if 
(!datasetLifecycleManager.isRegistered(datasetId)) {
 // it's possible this dataset has been dropped
 logRecord = logReader.next();
 continue;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/059ab964/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java
--
diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java
index 017c59f..5aa1b36 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java
@@ -56,6 +56,7 @@ import 
org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentId;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponent;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexAccessor;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMMemoryComponent;
+import org.apache.hyracks.test.support.TestUtils;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -75,6 +76,7 @@ public class ComponentRollbackTest {
 

[09/16] asterixdb git commit: [NO ISSUE][RT] Allow getting the value of a span duration

2018-08-31 Thread mblow
[NO ISSUE][RT] Allow getting the value of a span duration

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Enable getting the duration for spans. This is useful for
  delay calculations.

Change-Id: Icce0ac0a0d47a26655bf640f3f1a92506d87c30e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2940
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


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

Branch: refs/heads/master
Commit: 9963a917b7518ae8fc2653efdf19b8c0dd7ec5c2
Parents: 6a6394a
Author: Abdullah Alamoudi 
Authored: Thu Aug 30 10:39:24 2018 -0700
Committer: abdullah alamoudi 
Committed: Thu Aug 30 14:03:49 2018 -0700

--
 .../hyracks-util/src/main/java/org/apache/hyracks/util/Span.java | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/9963a917/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/Span.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/Span.java
 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/Span.java
index e75a961..183cb6f 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/Span.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/Span.java
@@ -29,6 +29,10 @@ public class Span {
 spanNanos = unit.toNanos(span);
 }
 
+public long getSpanNanos() {
+return spanNanos;
+}
+
 public static Span start(long span, TimeUnit unit) {
 return new Span(span, unit);
 }



[01/16] asterixdb git commit: [NO ISSUE][NET] Ensure Thread Safety in FullFrameChannelReadInterface

2018-08-31 Thread mblow
Repository: asterixdb
Updated Branches:
  refs/heads/master 8bf93fa70 -> 675244029


[NO ISSUE][NET] Ensure Thread Safety in FullFrameChannelReadInterface

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Use a blocking deque in FullFrameChannelReadInterface
  to ensure thread safety between frame consumer and
  the networking thread.

Change-Id: I33f0171e49b0ff972730a678e8b61a2070dc8832
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2921
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Murtadha Hubail 
Reviewed-by: Michael Blow 


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

Branch: refs/heads/master
Commit: 0b99332f6c85ea32a79780dc25c0f7b6fd3b75c9
Parents: 167518f
Author: Murtadha Hubail 
Authored: Sat Aug 18 13:34:59 2018 -0700
Committer: Murtadha Hubail 
Committed: Sun Aug 19 08:42:56 2018 -0700

--
 .../muxdemux/FullFrameChannelReadInterface.java   | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0b99332f/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
index 049cfd8..32bf77e 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
@@ -21,8 +21,8 @@ package org.apache.hyracks.net.protocols.muxdemux;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
-import java.util.ArrayDeque;
-import java.util.Deque;
+import java.util.concurrent.BlockingDeque;
+import java.util.concurrent.LinkedBlockingDeque;
 
 import org.apache.hyracks.api.comm.IBufferFactory;
 import org.apache.hyracks.api.comm.IChannelControlBlock;
@@ -33,22 +33,20 @@ import org.apache.logging.log4j.Logger;
 public class FullFrameChannelReadInterface extends 
AbstractChannelReadInterface {
 
 private static final Logger LOGGER = LogManager.getLogger();
-private final Deque riEmptyStack;
+private final BlockingDeque riEmptyStack;
 private final IChannelControlBlock ccb;
 
 FullFrameChannelReadInterface(IChannelControlBlock ccb) {
 this.ccb = ccb;
-riEmptyStack = new ArrayDeque<>();
+riEmptyStack = new LinkedBlockingDeque<>();
 credits = 0;
 
 emptyBufferAcceptor = buffer -> {
-int delta = buffer.remaining();
-synchronized (ccb) {
-if (ccb.isRemotelyClosed()) {
-return;
-}
-riEmptyStack.push(buffer);
+if (ccb.isRemotelyClosed()) {
+return;
 }
+riEmptyStack.push(buffer);
+final int delta = buffer.remaining();
 ccb.addPendingCredits(delta);
 };
 }



[03/16] asterixdb git commit: [ASTERIXDB-2446][COMP] Improve error raised for a duplicate field name

2018-08-31 Thread mblow
[ASTERIXDB-2446][COMP] Improve error raised for a duplicate field name

- user model changes: yes
- storage format changes: no
- interface changes: no

Details:
- Improve error raised in case when there is a duplicate field name
  in the SELECT clause. Throw compilation exception instead of
  IllegalStateException at runtime

Change-Id: I2f442acd73b3018058909f65626694dfbb49acc6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2930
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


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

Branch: refs/heads/master
Commit: c410e83270947af25b5dc373cbf9c8d74a0789a0
Parents: 938d76f
Author: Dmitry Lychagin 
Authored: Mon Aug 27 14:19:05 2018 -0700
Committer: Dmitry Lychagin 
Committed: Mon Aug 27 17:41:30 2018 -0700

--
 .../query-ASTERIXDB-2446.1.query.sqlpp  | 24 ++
 .../query-ASTERIXDB-2446.2.query.sqlpp  | 26 
 .../query-ASTERIXDB-2446.3.query.sqlpp  | 26 
 .../resources/runtimets/testsuite_sqlpp.xml |  8 ++
 .../impl/ClosedRecordConstructorResultType.java | 14 ---
 .../impl/OpenRecordConstructorResultType.java   |  5 
 6 files changed, 100 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c410e832/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.1.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.1.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.1.query.sqlpp
new file mode 100644
index 000..554cf28
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.1.query.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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: Ensure error if there's a duplicate field name in the 
SELECT clause
+ */
+
+select t as a, 2 as a from range(1, 10) t

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c410e832/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.2.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.2.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.2.query.sqlpp
new file mode 100644
index 000..b548b5d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/flwor/query-ASTERIXDB-2446/query-ASTERIXDB-2446.2.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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: Ensure error if there's a duplicate field name 

[04/16] asterixdb git commit: [ASTERIXDB-2444][STO] Avoid Using System Clock in Storage

2018-08-31 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/865a2ed0/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
index 57fd01d..1f481c9 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
@@ -21,12 +21,9 @@ package org.apache.hyracks.storage.am.lsm.common.impls;
 
 import java.io.FilenameFilter;
 import java.io.IOException;
-import java.text.Format;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 
@@ -42,7 +39,9 @@ import 
org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexFileManager;
 import org.apache.hyracks.storage.common.buffercache.IBufferCache;
 import org.apache.hyracks.storage.common.buffercache.ICachedPage;
 import org.apache.hyracks.storage.common.file.BufferedFileHandle;
+import org.apache.hyracks.util.annotations.NotThreadSafe;
 
+@NotThreadSafe
 public abstract class AbstractLSMIndexFileManager implements 
ILSMIndexFileManager {
 
 public enum TreeIndexState {
@@ -76,22 +75,18 @@ public abstract class AbstractLSMIndexFileManager 
implements ILSMIndexFileManage
  */
 public static final String TXN_PREFIX = ".T";
 
-public static final String COMPONENT_TIMESTAMP_FORMAT = 
"-MM-dd-HH-mm-ss-SSS";
-
 public static final FilenameFilter COMPONENT_FILES_FILTER = (dir, name) -> 
!name.startsWith(".");
 protected static final FilenameFilter txnFileNameFilter = (dir, name) -> 
name.startsWith(TXN_PREFIX);
 protected static FilenameFilter bloomFilterFilter =
 (dir, name) -> !name.startsWith(".") && 
name.endsWith(BLOOM_FILTER_SUFFIX);
-protected static final FilenameFilter dummyFilter = (dir, name) -> true;
 protected static final Comparator cmp = new FileNameComparator();
+private static final FilenameFilter dummyFilter = (dir, name) -> true;
 
 protected final IIOManager ioManager;
 // baseDir should reflect dataset name and partition name and be absolute
 protected final FileReference baseDir;
-protected final Format formatter = new 
SimpleDateFormat(COMPONENT_TIMESTAMP_FORMAT);
-protected final Comparator recencyCmp = new 
RecencyComparator();
+protected final Comparator recencyCmp = new 
RecencyComparator();
 protected final TreeIndexFactory treeFactory;
-private String prevTimestamp = null;
 
 public AbstractLSMIndexFileManager(IIOManager ioManager, FileReference 
file,
 TreeIndexFactory treeFactory) {
@@ -131,18 +126,18 @@ public abstract class AbstractLSMIndexFileManager 
implements ILSMIndexFileManage
 }
 
 protected void cleanupAndGetValidFilesInternal(FilenameFilter filter,
-TreeIndexFactory treeFactory, 
ArrayList allFiles,
+TreeIndexFactory treeFactory, 
ArrayList allFiles,
 IBufferCache bufferCache) throws HyracksDataException {
 String[] files = listDirFiles(baseDir, filter);
 for (String fileName : files) {
 FileReference fileRef = baseDir.getChild(fileName);
 if (treeFactory == null) {
-allFiles.add(new ComparableFileName(fileRef));
+allFiles.add(IndexComponentFileReference.of(fileRef));
 continue;
 }
 TreeIndexState idxState = 
isValidTreeIndex(treeFactory.createIndexInstance(fileRef));
 if (idxState == TreeIndexState.VALID) {
-allFiles.add(new ComparableFileName(fileRef));
+allFiles.add(IndexComponentFileReference.of(fileRef));
 } else if (idxState == TreeIndexState.INVALID) {
 bufferCache.deleteFile(fileRef);
 }
@@ -167,18 +162,16 @@ public abstract class AbstractLSMIndexFileManager 
implements ILSMIndexFileManage
 return files;
 }
 
-protected void validateFiles(HashSet groundTruth, 
ArrayList validFiles,
+protected void validateFiles(HashSet groundTruth, 
ArrayList validFiles,
 FilenameFilter filter, TreeIndexFactory 
treeFactory, IBufferCache bufferCache)
 throws HyracksDataException {
-ArrayList tmpAllInvListsFiles = new ArrayList<>();
+ArrayList tmpAllInvListsFiles = new 

[02/16] asterixdb git commit: [NO ISSUE][FAIL] Fix message for over-/underflow

2018-08-31 Thread mblow
[NO ISSUE][FAIL] Fix message for over-/underflow

Change-Id: I1d2b071dce8f6ed485d57f131d5c9f8893041678
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2925
Reviewed-by: Murtadha Hubail 
Sonar-Qube: Jenkins 
Tested-by: Jenkins 


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

Branch: refs/heads/master
Commit: 938d76f1801a09eada0a674a759c6d3aee2902c1
Parents: 0b99332
Author: Till Westmann 
Authored: Tue Aug 21 09:50:18 2018 -0700
Committer: Till Westmann 
Committed: Tue Aug 21 11:53:45 2018 -0700

--
 .../asterix-common/src/main/resources/asx_errormsg/en.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/938d76f1/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
--
diff --git 
a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties 
b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index f0dfd1a..7158b95 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -43,8 +43,8 @@
 
 # Data errors
 6 = Invalid format for %1$s in %2$s
-7 = Overflow happend in %1$s
-8 = Underflow happend in %1$s
+7 = Overflow in %1$s
+8 = Underflow in %1$s
 9 = Injected failure in %1$s
 10 = Invalid value: function %1$s expects its %2$s input parameter to be a 
non-negative value, but gets %3$s
 11 = Index out of bound in %1$s: %2$s



[10/16] asterixdb git commit: [ASTERIXDB-2447][COMP] Parameter rewriting for if_missing, if_null functions

2018-08-31 Thread mblow
[ASTERIXDB-2447][COMP] Parameter rewriting for if_missing, if_null functions

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Introduce cast operation for parameters of if_missing, if_null functions
  (as performed for parameters of the switch_case function)
- Fix union type handling in TypeResolverUtil.generalizeTypes()

Change-Id: I768d8236f5b0ccb9a850304ffedd3686d911702d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2935
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


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

Branch: refs/heads/master
Commit: 8c88975a781cd2b384da31bcd59aad2e26480e3e
Parents: 9963a91
Author: Dmitry Lychagin 
Authored: Tue Aug 28 16:32:42 2018 -0700
Committer: Dmitry Lychagin 
Committed: Thu Aug 30 17:31:14 2018 -0700

--
 .../rules/InjectTypeCastForSwitchCaseRule.java  | 71 +++-
 .../ifmissing/ifmissing.1.query.sqlpp   |  7 ++
 .../ifmissingornull.1.query.sqlpp   |  7 ++
 .../null-missing/ifnull/ifnull.1.query.sqlpp|  7 ++
 .../null-missing/ifmissing/ifmissing.1.adm  |  2 +-
 .../ifmissingornull/ifmissingornull.1.adm   |  2 +-
 .../results/null-missing/ifnull/ifnull.1.adm|  2 +-
 .../dataflow/data/common/TypeResolverUtil.java  |  2 +-
 8 files changed, 81 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8c88975a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForSwitchCaseRule.java
--
diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForSwitchCaseRule.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForSwitchCaseRule.java
index fa9385a..683d29f 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForSwitchCaseRule.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForSwitchCaseRule.java
@@ -22,6 +22,7 @@ package org.apache.asterix.optimizer.rules;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.asterix.dataflow.data.common.TypeResolverUtil;
 import org.apache.asterix.lang.common.util.FunctionUtil;
@@ -38,14 +39,23 @@ import 
org.apache.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
 import 
org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
 import 
org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
 import 
org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 import org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
 
+import com.google.common.collect.ImmutableSet;
+
 /**
- * This rule injects cast functions for "THEN" and "ELSE" branches of a 
switch-case function if
- * different "THEN" and "ELSE" branches have heterogeneous return types.
+ * This rule injects casts for function parameters if they have heterogeneous 
return types:
+ * 
+ * for "THEN" and "ELSE" branches of a switch-case function
+ * for parameters of "if missing/null" functions  (if-missing(), 
if-null(), if-missing-or-null())
+ * 
  */
 public class InjectTypeCastForSwitchCaseRule implements IAlgebraicRewriteRule {
 
+private static final Set IF_FUNCTIONS =
+ImmutableSet.of(BuiltinFunctions.IF_MISSING, 
BuiltinFunctions.IF_NULL, BuiltinFunctions.IF_MISSING_OR_NULL);
+
 @Override
 public boolean rewritePost(Mutable opRef, 
IOptimizationContext context)
 throws AlgebricksException {
@@ -80,10 +90,17 @@ public class InjectTypeCastForSwitchCaseRule implements 
IAlgebraicRewriteRule {
 rewritten = true;
 }
 }
-if 
(!func.getFunctionIdentifier().equals(BuiltinFunctions.SWITCH_CASE)) {
-return rewritten;
+FunctionIdentifier funcId = func.getFunctionIdentifier();
+if (funcId.equals(BuiltinFunctions.SWITCH_CASE)) {
+if (rewriteSwitchCase(op, func, context)) {
+rewritten = true;
+}
+} else if (IF_FUNCTIONS.contains(funcId)) {
+if (rewriteFunction(op, func, context)) {
+rewritten = true;
+}
 }
-return rewriteSwitchCase(op, func, context);
+return rewritten;
 }
 
 // Injects 

[06/16] asterixdb git commit: [NO ISSUE] Allow override of dead node sweeper threshold

2018-08-31 Thread mblow
[NO ISSUE] Allow override of dead node sweeper threshold

Change-Id: I3e534c277e52778ec4551247842acc51960a61b4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2922
Integration-Tests: Jenkins 
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Reviewed-by: Murtadha Hubail 


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

Branch: refs/heads/master
Commit: bdb1cb4e1033cabcf81866ca1ebc6e259dc97c10
Parents: 865a2ed
Author: Michael Blow 
Authored: Mon Aug 20 07:30:52 2018 -0400
Committer: Michael Blow 
Committed: Thu Aug 30 09:29:57 2018 -0700

--
 .../hyracks/control/cc/ClusterControllerService.java   |  2 +-
 .../hyracks/control/common/controllers/CCConfig.java   | 13 -
 .../hyracks/control/nc/heartbeat/HeartbeatManager.java |  1 -
 3 files changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bdb1cb4e/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
index ae82803..b5dacfb 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
@@ -217,7 +217,7 @@ public class ClusterControllerService implements 
IControllerService {
 webServer.start();
 info = new ClusterControllerInfo(ccId, 
ccConfig.getClientPublicAddress(), ccConfig.getClientPublicPort(),
 ccConfig.getConsolePublicPort());
-timer.schedule(sweeper, 0, ccConfig.getHeartbeatPeriodMillis());
+timer.schedule(sweeper, 0, ccConfig.getDeadNodeSweepThreshold());
 jobLog.open();
 startApplication();
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bdb1cb4e/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
index f83df6e..1cb2d05 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
@@ -60,6 +60,7 @@ public class CCConfig extends ControllerConfig {
 CONSOLE_PUBLIC_PORT(INTEGER, CONSOLE_LISTEN_PORT),
 HEARTBEAT_PERIOD(LONG, 1L), // TODO (mblow): add time unit
 HEARTBEAT_MAX_MISSES(INTEGER, 5),
+DEAD_NODE_SWEEP_THRESHOLD(LONG, HEARTBEAT_PERIOD),
 PROFILE_DUMP_PERIOD(INTEGER, 0),
 JOB_HISTORY_SIZE(INTEGER, 10),
 RESULT_TTL(LONG, 8640L), // TODO(mblow): add time unit
@@ -154,7 +155,9 @@ public class CCConfig extends ControllerConfig {
 case HEARTBEAT_PERIOD:
 return "Sets the time duration between two heartbeats from 
each node controller in milliseconds";
 case HEARTBEAT_MAX_MISSES:
-return "Sets the maximum number of missed heartbeats 
before a node is marked as dead";
+return "Sets the maximum number of missed heartbeats 
before a node can be considered dead";
+case DEAD_NODE_SWEEP_THRESHOLD:
+return "Sets the frequency (in milliseconds) to process 
nodes that can be considered dead";
 case PROFILE_DUMP_PERIOD:
 return "Sets the time duration between two profile dumps 
from each node controller in "
 + "milliseconds; 0 to disable";
@@ -326,6 +329,14 @@ public class CCConfig extends ControllerConfig {
 configManager.set(Option.HEARTBEAT_MAX_MISSES, heartbeatMaxMisses);
 }
 
+public long getDeadNodeSweepThreshold() {
+return 

[11/16] asterixdb git commit: [NO ISSUE][STO] Add API to Get Total Disk Usage

2018-08-31 Thread mblow
[NO ISSUE][STO] Add API to Get Total Disk Usage

- user model changes: no
- storage format changes: no
- interface changes: yes

Details:
- Add new API to get total disk usage of all
  NC io devices.

Change-Id: Iba1538205dbadef8b50be6373dbe7525d0ef
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2943
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Reviewed-by: Till Westmann 
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/ecbb73fd
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/ecbb73fd
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/ecbb73fd

Branch: refs/heads/master
Commit: ecbb73fd6e9ec9737b9db5d822b5e2c97638a366
Parents: 8c88975
Author: Murtadha Hubail 
Authored: Fri Aug 31 04:06:01 2018 +0300
Committer: Murtadha Hubail 
Committed: Thu Aug 30 23:34:46 2018 -0700

--
 .../main/java/org/apache/hyracks/api/io/IIOManager.java   |  7 +++
 .../java/org/apache/hyracks/control/nc/io/IOManager.java  | 10 ++
 2 files changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ecbb73fd/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IIOManager.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IIOManager.java
 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IIOManager.java
index ff1e47f..962f826 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IIOManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/IIOManager.java
@@ -97,4 +97,11 @@ public interface IIOManager extends Closeable {
  * @throws HyracksDataException
  */
 FileReference createWorkspaceFile(String prefix) throws 
HyracksDataException;
+
+/**
+ * Gets the total disk usage in bytes of this {@link IIOManager} io 
devices handles.
+ *
+ * @return the total disk usage in bytes
+ */
+long getTotalDiskUsage();
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ecbb73fd/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 d13ca8d..b5cb21a 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
@@ -36,6 +36,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.hyracks.api.exceptions.ErrorCode;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.FileReference;
@@ -416,4 +417,13 @@ public class IOManager implements IIOManager {
 Thread.currentThread().interrupt();
 }
 }
+
+@Override
+public long getTotalDiskUsage() {
+long totalSize = 0;
+for (IODeviceHandle handle : ioDevices) {
+totalSize += FileUtils.sizeOfDirectory(handle.getMount());
+}
+return totalSize;
+}
 }



[08/16] asterixdb git commit: [NO ISSUE][CLUS] Ensure Active Jobs Capacity is Released Only Once

2018-08-31 Thread mblow
[NO ISSUE][CLUS] Ensure Active Jobs Capacity is Released Only Once

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Ensure active jobs capacity is released only once.
- Warn if the cluster maximum capacity is exceeded.

Change-Id: Ia53c6918a68f7050bd8af482dbe8e161d1315844
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2938
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Murtadha Hubail 
Reviewed-by: Michael Blow 


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

Branch: refs/heads/master
Commit: 6a6394a30f448ecc12ad4728ede5c6c2c53059b4
Parents: a952e01
Author: Murtadha Hubail 
Authored: Thu Aug 30 14:04:12 2018 +0300
Committer: Michael Blow 
Committed: Thu Aug 30 09:45:55 2018 -0700

--
 .../runtime/job/resource/JobCapacityController.java   | 13 +
 .../org/apache/hyracks/control/cc/job/JobManager.java | 14 --
 2 files changed, 21 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/6a6394a3/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/job/resource/JobCapacityController.java
--
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/job/resource/JobCapacityController.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/job/resource/JobCapacityController.java
index 8ea1fa7..b123a5e 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/job/resource/JobCapacityController.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/job/resource/JobCapacityController.java
@@ -26,12 +26,15 @@ import org.apache.hyracks.api.job.resource.IClusterCapacity;
 import org.apache.hyracks.api.job.resource.IJobCapacityController;
 import org.apache.hyracks.api.job.resource.IReadOnlyClusterCapacity;
 import org.apache.hyracks.control.cc.scheduler.IResourceManager;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 // To avoid the computation cost for checking the capacity constraint for each 
node,
 // currently the admit/allocation decisions are based on the aggregated 
resource information.
 // TODO(buyingyi): investigate partition-aware resource control.
 public class JobCapacityController implements IJobCapacityController {
 
+private static final Logger LOGGER = LogManager.getLogger();
 private final IResourceManager resourceManager;
 
 public JobCapacityController(IResourceManager resourceManager) {
@@ -71,6 +74,16 @@ public class JobCapacityController implements 
IJobCapacityController {
 int aggregatedNumCores = currentCapacity.getAggregatedCores();
 currentCapacity.setAggregatedMemoryByteSize(aggregatedMemoryByteSize + 
reqAggregatedMemoryByteSize);
 currentCapacity.setAggregatedCores(aggregatedNumCores + 
reqAggregatedNumCores);
+ensureMaxCapacity();
 }
 
+private void ensureMaxCapacity() {
+final IClusterCapacity currentCapacity = 
resourceManager.getCurrentCapacity();
+final IReadOnlyClusterCapacity maximumCapacity = 
resourceManager.getMaximumCapacity();
+if (currentCapacity.getAggregatedCores() > 
maximumCapacity.getAggregatedCores()
+|| currentCapacity.getAggregatedMemoryByteSize() > 
maximumCapacity.getAggregatedMemoryByteSize()) {
+LOGGER.warn("Current cluster available capacity {} is more than 
its maximum capacity {}", currentCapacity,
+maximumCapacity);
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/6a6394a3/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java
index 7dc636c..7e1ca61 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java
@@ -229,8 +229,9 @@ public class JobManager implements IJobManager {
 }
 run.setStatus(run.getPendingStatus(), run.getPendingExceptions());
 

[16/16] asterixdb git commit: Merge commit '95f508bbb1d07650392c21da2958ba1c53f2a03d' from stabilization-f69489

2018-08-31 Thread mblow
Merge commit '95f508bbb1d07650392c21da2958ba1c53f2a03d' from 
stabilization-f69489

Change-Id: Ib6a428564681938dceb6ad4a2ba91f15256dc8a2


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

Branch: refs/heads/master
Commit: 675244029cc9624795d54aeed5e2b6f7aafd2905
Parents: 8bf93fa 95f508b
Author: Michael Blow 
Authored: Fri Aug 31 14:06:19 2018 -0400
Committer: Michael Blow 
Committed: Fri Aug 31 14:06:57 2018 -0400

--
 .../rules/InjectTypeCastForSwitchCaseRule.java  |  71 ++--
 .../am/IntroduceSelectAccessMethodRule.java |  18 ++-
 .../asterix/app/nc/IndexCheckpointManager.java  |  34 ++--
 .../apache/asterix/app/nc/RecoveryManager.java  |   4 +-
 .../test/dataflow/ComponentRollbackTest.java|  34 ++--
 .../dataflow/TestLsmIoOpCallbackFactory.java|  10 +-
 ...TestPrimaryIndexOperationTrackerFactory.java |   5 +-
 .../PersistentLocalResourceRepositoryTest.java  |  25 +--
 .../btree-index/btree-secondary-68.sqlpp|  54 +++
 .../results/btree-index/btree-secondary-68.plan |  32 
 .../binary/concat2/concat2.1.query.sqlpp|  25 +++
 .../query-ASTERIXDB-2446.1.query.sqlpp  |  24 +++
 .../query-ASTERIXDB-2446.2.query.sqlpp  |  26 +++
 .../query-ASTERIXDB-2446.3.query.sqlpp  |  26 +++
 .../intersection-with-between.1.ddl.sqlpp   |  43 +
 .../intersection-with-between.2.update.sqlpp|  23 +++
 .../intersection-with-between.3.ddl.sqlpp   |  24 +++
 .../intersection-with-between.4.query.sqlpp |  26 +++
 .../ifmissing/ifmissing.1.query.sqlpp   |   7 +
 .../ifmissingornull.1.query.sqlpp   |   7 +
 .../null-missing/ifnull/ifnull.1.query.sqlpp|   7 +
 .../string-concat2/string-concat2.1.query.sqlpp |  25 +++
 .../string-concat2/string-concat2.2.query.sqlpp |  25 +++
 .../results/binary/concat2/concat2.1.adm|   1 +
 .../intersection-with-between.4.adm |   7 +
 .../push-limit-to-primary-scan-select.8.adm |   2 +-
 .../null-missing/ifmissing/ifmissing.1.adm  |   2 +-
 .../ifmissingornull/ifmissingornull.1.adm   |   2 +-
 .../results/null-missing/ifnull/ifnull.1.adm|   2 +-
 .../string/string-concat2/string-concat2.1.adm  |   1 +
 .../string/string-concat2/string-concat2.2.adm  |   1 +
 .../resources/runtimets/testsuite_sqlpp.xml |  23 +++
 .../common/api/IDatasetLifecycleManager.java|  15 +-
 .../DatasetLSMComponentIdGeneratorFactory.java  |   2 +-
 .../common/context/DatasetLifecycleManager.java |  39 +++--
 .../ioopcallbacks/LSMIOOperationCallback.java   |  12 +-
 .../common/storage/IIndexCheckpointManager.java |  28 ++--
 .../asterix/common/storage/IndexCheckpoint.java |  14 +-
 .../common/storage/ResourceReference.java   |   9 ++
 .../main/resources/asx_errormsg/en.properties   |   4 +-
 .../LSMIOOperationCallbackTest.java |  26 ++-
 .../visitor/OperatorExpressionVisitor.java  |  16 +-
 .../dataflow/data/common/TypeResolverUtil.java  |   2 +-
 .../asterix/om/functions/BuiltinFunctions.java  |   5 +-
 .../impl/ClosedRecordConstructorResultType.java |  14 +-
 .../typecomputer/impl/ConcatTypeComputer.java   |  64 
 .../impl/OpenRecordConstructorResultType.java   |   5 +
 .../CheckpointPartitionIndexesTask.java |  12 +-
 .../messaging/ComponentMaskTask.java|   4 +-
 .../messaging/MarkComponentValidTask.java   |  14 +-
 .../messaging/ReplicateFileTask.java|   2 +-
 .../functions/StringConcatDescriptor.java   |  11 +-
 .../binary/BinaryConcatDescriptor.java  |  27 ++--
 .../job/resource/JobCapacityController.java |  13 ++
 .../PrimaryIndexOperationTrackerFactory.java|   2 +-
 .../PersistentLocalResourceRepository.java  |  51 ++
 .../org/apache/hyracks/api/io/IIOManager.java   |   7 +
 .../comm/channels/NetworkOutputChannel.java |  12 +-
 .../control/cc/ClusterControllerService.java|   2 +-
 .../hyracks/control/cc/job/JobManager.java  |  14 +-
 .../control/common/controllers/CCConfig.java|  13 +-
 .../control/nc/heartbeat/HeartbeatManager.java  |   1 -
 .../apache/hyracks/control/nc/io/IOManager.java |  10 ++
 .../protocols/muxdemux/ChannelControlBlock.java |   5 +
 .../net/protocols/muxdemux/ChannelSet.java  |   4 +
 .../muxdemux/FullFrameChannelReadInterface.java |  18 +--
 .../muxdemux/MultiplexedConnection.java |   5 +
 .../am/lsm/btree/impls/LSMBTreeFileManager.java |  77 -
 .../impls/LSMBTreeWithBuddyFileManager.java | 100 +---
 .../common/api/ILSMComponentIdGenerator.java|   1 -
 .../impls/AbstractLSMIndexFileManager.java  | 160 +--
 .../impls/IndexComponentFileReference.java  | 131 +++
 

[15/16] asterixdb git commit: [NO ISSUE][OTH] Remove Unused Variable

2018-08-31 Thread mblow
[NO ISSUE][OTH] Remove Unused Variable

- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: Ie782fd0bc081f3daa5eb77d2db556a1effb5600e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2949
Reviewed-by: Murtadha Hubail 
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Michael Blow 


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

Branch: refs/heads/master
Commit: 95f508bbb1d07650392c21da2958ba1c53f2a03d
Parents: bcc9347
Author: Murtadha Hubail 
Authored: Fri Aug 31 15:42:09 2018 +0300
Committer: Murtadha Hubail 
Committed: Fri Aug 31 10:18:33 2018 -0700

--
 .../apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/95f508bb/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
--
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
index 53bc31b..0aa46a8 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
@@ -72,7 +72,6 @@ public class LSMIOOperationCallback implements 
ILSMIOOperationCallback {
 private long persistenceLsn = 0L;
 private int pendingFlushes = 0;
 private Deque componentIds = new ArrayDeque<>();
-private boolean firstAllocation = true;
 
 public LSMIOOperationCallback(DatasetInfo dsInfo, ILSMIndex lsmIndex, 
ILSMComponentId componentId,
 IIndexCheckpointManagerProvider indexCheckpointManagerProvider) {



svn commit: r29073 - /dev/asterixdb/

2018-08-31 Thread imaxon
Author: imaxon
Date: Fri Aug 31 21:58:22 2018
New Revision: 29073

Log:
upload 0.9.4 and 0.3.4

Added:
dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip   (with props)
dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip.asc
dev/asterixdb/apache-hyracks-0.3.4-source-release.zip   (with props)
dev/asterixdb/apache-hyracks-0.3.4-source-release.zip.asc
dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip   (with props)
dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip.asc
Removed:
dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip.sha1
dev/asterixdb/apache-hyracks-0.3.4-source-release.zip.sha1
dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip.sha1
dev/asterixdb/asterix-server-0.9.4.deb
dev/asterixdb/asterix-server-0.9.4.deb.asc
dev/asterixdb/asterix-server-0.9.4.deb.sha1

Added: dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip
==
Binary file - no diff available.

Propchange: dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip
--
svn:mime-type = application/octet-stream

Added: dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip.asc
==
--- dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip.asc (added)
+++ dev/asterixdb/apache-asterixdb-0.9.4-source-release.zip.asc Fri Aug 31 
21:58:22 2018
@@ -0,0 +1,17 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v2.0.14 (GNU/Linux)
+
+iQIcBAABAgAGBQJbibhOAAoJEKmP6oelbqmAjPwP/RAWJyCafK09aaYa7AS7F7n3
+fF55A8FsTjXCiAqVUXLicAQDVAZl2iwTHY6IZjIWyTRGSoxjH++juZ4bYHO/Cl+8
+5+ZyrudqdOVy5tzCOsiEvKvzXYh4MfltlIOieRwAcaFeEFKbHyAGDilIhvHPCskk
+449UHAckZT7/dET04of1nehEB23p92QoLDR8u61hj0Qb215mtbVR9G6G99gII3G6
+0Y7+KFiiH/r4Qmd5TleciFCm2G7AcrjaLEbYoZj2R58L29VTMMzPLTULrW+UdG5I
+VtxP1JDTjR79xag9jJHKqnCjyRqu2tE+Wj6um7tk56Df45I/jK8E7qD/w5/NK10X
+2oz9OSpIEWQuZikJt4KnEPQh/BnA5X+oxM3XyU9PSyT5QELX76IVcvQxdqVA7im1
+SjOp/0SEyLPMvwQSPlL3j1amHfCaGDp6xX5VTtHdSvkDrQfIh2UqEpargpimrB9C
+GopAkiwyuVxunhSNaDErWVsV8poDKmqs97NOquqtTLO2THYsX3KK/GS+t8u8EEGl
+WsoG40SiL8TOcD8lNy8EUTypvez/JTX9vUBRjragQpddfhUZBhk8D3TY9HD5PQk+
+woE7CjMz4tnEet6m1gsWt/vjaEsJIqUm3N6nkecSOMrJk7MxVbB5BCVg3R/aV4IM
+Oqm3SWBIWSArHP/QpE+E
+=cJLk
+-END PGP SIGNATURE-

Added: dev/asterixdb/apache-hyracks-0.3.4-source-release.zip
==
Binary file - no diff available.

Propchange: dev/asterixdb/apache-hyracks-0.3.4-source-release.zip
--
svn:mime-type = application/octet-stream

Added: dev/asterixdb/apache-hyracks-0.3.4-source-release.zip.asc
==
--- dev/asterixdb/apache-hyracks-0.3.4-source-release.zip.asc (added)
+++ dev/asterixdb/apache-hyracks-0.3.4-source-release.zip.asc Fri Aug 31 
21:58:22 2018
@@ -0,0 +1,17 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v2.0.14 (GNU/Linux)
+
+iQIcBAABAgAGBQJbibc5AAoJEKmP6oelbqmAhesP/ifvzLjsTZqBt2/fvFjBoAke
+XvOQfVRhlnGZznmWWueWfTF+7e2HEuwC2yXNup+Aa5BAwnzb4TIv0UXDQ2Rx5lCL
+CDgSWSWuSbF6ecSC/3DR/qeYjBo4d1iOyCfObOll9e1KszjY1ZZb2rTFKfYDMMhI
+rlWaD8n4tLPCxzGXdpR1/B23yWwFZxQX/GzbZw8MkmZ+nAl7Rb0CSCTWCaPZV4JY
+lXOyXny34SSd47Yq2ynrhKMmTKLzQfFsfs6PR5kZNKe+kUYOYIRRICLyL/Dms6gM
+4kpozxTZq/rM5qpeZQ1sIBt/pX2z06rGcGCeRruPtwQOrYMo+iPqor/O5SpIcJj1
+HrGCZ4w39nt9jKRN8uQe+2pqWk6FqtU6qIHT2Kwm+an9ElPFTcDUodHH+XyXCD2u
+feM8o+788CcBs2mXJYbmYQ2larTJexmc5T98BPweS+a/sP/ssPFCacvLQmKm7pt+
+mVYO7T5u1Wc6DS0Iaz4AnC/3Zo38O1Cj/rLAOKoeYKOiywXacAeJGMZqCTSQm/op
+ta2d4KfyOer+FhViTsAJjPSAaqeEV/4G+a7vBHDgcmYkZYcfY9Km5djPCWaKpAFu
+Gtsgyn4OuFgrxPXBmC2Mw8Rf4iLWLOoIsQnPmCAcweOWib7/oZ/otQy0QIFOXGZb
+Wo/Sivf9tQTFZePlZCl9
+=oSyO
+-END PGP SIGNATURE-

Added: dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip
==
Binary file - no diff available.

Propchange: dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip
--
svn:mime-type = application/octet-stream

Added: dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip.asc
==
--- dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip.asc (added)
+++ dev/asterixdb/asterix-server-0.9.4-binary-assembly.zip.asc Fri Aug 31 
21:58:22 2018
@@ -0,0 +1,17 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v2.0.14 (GNU/Linux)
+
+iQIcBAABAgAGBQJbibluAAoJEKmP6oelbqmApgwQALyMLbzzbDPp4aOGcinNqblX
+8kFNRC9cTiAqeDcnSBIEA9MXPPhHE0mOvkyWx7z1ycpPgHMcrM7fYmROS96iH490
+71LKjATUoH5ohBjwoTnVGVImMavBhS9VeRg2HIwmgxI56g3/1AIUiAs/pk16k/f4
+M4uEcx69fPJL+4GB6rL0NP/7890VuQgZrVcMTj6ePUCxYwLkQRiCmauRr6qrY15m

asterixdb git commit: Revert "[NO ISSUE][LOG] Include destination IP in thread name on push back"

2018-08-31 Thread amoudi
Repository: asterixdb
Updated Branches:
  refs/heads/master 129d401bf -> 8bf93fa70


Revert "[NO ISSUE][LOG] Include destination IP in thread name on push back"

This reverts commit 2498d28f0584d6ab002625417622be429f5c8131.

Change-Id: I221071a8a2851bde839e67d7f0380816c249366d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2941
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Contrib: Jenkins 
Reviewed-by: Murtadha Hubail 


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

Branch: refs/heads/master
Commit: 8bf93fa70aaf44deced9737ef71001366a35b242
Parents: 129d401
Author: abdullah alamoudi 
Authored: Thu Aug 30 13:57:44 2018 -0700
Committer: abdullah alamoudi 
Committed: Fri Aug 31 00:05:58 2018 -0700

--
 .../hyracks/comm/channels/NetworkOutputChannel.java | 12 +---
 .../net/protocols/muxdemux/ChannelControlBlock.java |  5 -
 .../hyracks/net/protocols/muxdemux/ChannelSet.java  |  4 
 .../net/protocols/muxdemux/MultiplexedConnection.java   |  5 -
 4 files changed, 1 insertion(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8bf93fa7/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
 
b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
index 261e7c4..334fb5c 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/NetworkOutputChannel.java
@@ -18,11 +18,9 @@
  */
 package org.apache.hyracks.comm.channels;
 
-import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.ArrayDeque;
 import java.util.Deque;
-import java.util.Objects;
 
 import org.apache.hyracks.api.comm.IBufferAcceptor;
 import org.apache.hyracks.api.comm.IFrameWriter;
@@ -77,15 +75,7 @@ public class NetworkOutputChannel implements IFrameWriter {
 break;
 }
 try {
-InetSocketAddress remoteAddress = 
ccb.getRemoteAddress();
-String nameBefore = Thread.currentThread().getName();
-try {
-Thread.currentThread()
-.setName(nameBefore + ":SendingTo(" + 
Objects.toString(remoteAddress) + ")");
-wait();
-} finally {
-Thread.currentThread().setName(nameBefore);
-}
+wait();
 } catch (InterruptedException e) {
 Thread.currentThread().interrupt();
 throw HyracksDataException.create(e);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8bf93fa7/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
index f7ef2aa..998acfb 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
@@ -19,7 +19,6 @@
 package org.apache.hyracks.net.protocols.muxdemux;
 
 import java.io.IOException;
-import java.net.InetSocketAddress;
 import java.nio.channels.SocketChannel;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -164,8 +163,4 @@ public class ChannelControlBlock implements 
IChannelControlBlock {
 + " remoteClose: " + remoteClose + " remoteCloseAck:" + 
remoteCloseAck + " readCredits: "
 + ri.getCredits() + " writeCredits: " + wi.getCredits() + "]";
 }
-
-public InetSocketAddress getRemoteAddress() {
-return cSet.getMultiplexedConnection().getRemoteAddress();
-}
 }