[ASTERIXDB-2656] Remove frame constraint in HHJ probe

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

Details:
During the probe phase, we should not have the 1-frame
limit for spilled partitions. It wastes the memory and
leads to flushing small objects directly to the disk as
a large object.

Change-Id: I7580ecbe7db36d018348cd82d3864ca6c2ff439d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/3703
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/IPartitionedTupleBufferManager.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/IPartitionedTupleBufferManager.java
index 6c08be2..b1605f3 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/IPartitionedTupleBufferManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/IPartitionedTupleBufferManager.java
@@ -80,6 +80,13 @@
     void cancelInsertTuple(int partition) throws HyracksDataException;
 
     /**
+     * Sets the constrain.
+     * @param constrain
+     *              the constrain to be set.
+     */
+    void setConstrain(IPartitionedMemoryConstrain constrain);
+
+    /**
      * Reset to the initial states. The previous allocated resources won't be released in order to be used in the next round.
      *
      * @throws HyracksDataException
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/VPartitionTupleBufferManager.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/VPartitionTupleBufferManager.java
index 731e7ed..dfa2b45 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/VPartitionTupleBufferManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/buffermanager/VPartitionTupleBufferManager.java
@@ -51,7 +51,7 @@
     private final FixedSizeFrame appendFrame;
     private final FixedSizeFrameTupleAppender appender;
     private BufferInfo tempInfo;
-    private final IPartitionedMemoryConstrain constrain;
+    private IPartitionedMemoryConstrain constrain;
 
     // In case where a frame pool is shared by one or more buffer manager(s), it can be provided from the caller.
     public VPartitionTupleBufferManager(IPartitionedMemoryConstrain constrain, int partitions,
@@ -77,6 +77,11 @@
     }
 
     @Override
+    public void setConstrain(IPartitionedMemoryConstrain constrain) {
+        this.constrain = constrain;
+    }
+
+    @Override
     public void reset() throws HyracksDataException {
         for (IFrameBufferManager part : partitionArray) {
             if (part != null) {
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoin.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoin.java
index 7b6dcdb..6fb55ec 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoin.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoin.java
@@ -432,6 +432,7 @@
 
     public void initProbe() {
         probePSizeInTups = new int[numOfPartitions];
+        bufferManager.setConstrain(VPartitionTupleBufferManager.NO_CONSTRAIN);
     }
 
     public void probe(ByteBuffer buffer, IFrameWriter writer) throws HyracksDataException {