This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 3e50a416e4a923457cd7f58a6588a78a8b1ca960
Merge: b893514 f95c8f5
Author: Michael Blow <[email protected]>
AuthorDate: Fri Jan 10 23:49:09 2020 -0500

    Merge branch 'gerrit/stabilization-f69489'
    
    Change-Id: I5b75e79a5dbe74314fec8b9ef7734a792ca5731c

 .../apache/asterix/test/common/TestExecutor.java   | 18 ++++++++-----
 .../asterix/test/sqlpp/ParserTestExecutor.java     | 13 +++++-----
 .../apache/hyracks/api/comm/NetworkAddress.java    |  9 +++++++
 .../common/controllers/NodeRegistration.java       | 30 +++++++++++++++++++---
 .../hyracks/control/nc/NodeControllerService.java  |  6 ++---
 .../protocols/muxdemux/ChannelControlBlock.java    |  2 +-
 .../hyracks/net/protocols/muxdemux/ChannelSet.java |  6 +++--
 .../org/apache/hyracks/util/file/FileUtil.java     | 20 +++++++++++++++
 .../org/apache/hyracks/util/file/FileUtilTest.java | 23 +++++++++++++++++
 9 files changed, 106 insertions(+), 21 deletions(-)

diff --cc 
asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
index 71ef783,9e2d028..a10dc54
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
@@@ -237,11 -224,8 +238,11 @@@ public class TestExecutor 
  
      public void runScriptAndCompareWithResult(File scriptFile, File 
expectedFile, File actualFile,
              ComparisonEnum compare, Charset actualEncoding) throws Exception {
-         LOGGER.info("Expected results file: {} ", expectedFile);
+         LOGGER.info("Expected results file: {} ", canonicalize(expectedFile));
          boolean regex = false;
 +        if (expectedFile.getName().endsWith(".ignore")) {
 +            return; //skip the comparison
 +        }
          try (BufferedReader readerExpected =
                  new BufferedReader(new InputStreamReader(new 
FileInputStream(expectedFile), UTF_8));
                  BufferedReader readerActual =
diff --cc 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeRegistration.java
index 474bc0a,bcf6d22..aa1a01f
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeRegistration.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeRegistration.java
@@@ -21,9 -21,9 +21,10 @@@ package org.apache.hyracks.control.comm
  import static org.apache.hyracks.util.MXHelper.osMXBean;
  import static org.apache.hyracks.util.MXHelper.runtimeMXBean;
  
+ import java.io.IOException;
  import java.io.Serializable;
  import java.net.InetSocketAddress;
 +import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
@@@ -79,12 -84,11 +86,12 @@@ public final class NodeRegistration imp
  
      private final NodeCapacity capacity;
  
 +    private final HashMap<SerializedOption, Object> config;
 +
-     public NodeRegistration(InetSocketAddress ncAddress, String nodeId, 
NCConfig ncConfig, NetworkAddress dataPort,
+     public NodeRegistration(NetworkAddress ncPort, String nodeId, NCConfig 
ncConfig, NetworkAddress dataPort,
              NetworkAddress resultPort, HeartbeatSchema hbSchema, 
NetworkAddress messagingPort, NodeCapacity capacity) {
-         this.ncAddress = ncAddress;
+         this.ncPort = ncPort;
          this.nodeId = nodeId;
 -        this.ncConfig = ncConfig;
          this.dataPort = dataPort;
          this.resultPort = resultPort;
          this.hbSchema = hbSchema;
@@@ -190,7 -189,24 +197,24 @@@
          return messagingPort;
      }
  
 -    public int getPid() {
 +    public long getPid() {
          return pid;
      }
+ 
+     private void readObject(java.io.ObjectInputStream ois) throws 
IOException, ClassNotFoundException {
+         ois.defaultReadObject();
+         if (ncPort == null) {
+             // writer was old; we need to create a NetworkAddress from the 
InetSocketAddress
+             LOGGER.warn(
+                     "deserializing old NodeRegistration for {}; address may 
be incorrectly resolved as it was resolved on the NC: {}",
+                     nodeId, ncAddress);
+             ncPort = new NetworkAddress(ncAddress.getHostString(), 
ncAddress.getPort());
+         }
+     }
+ 
+     private void writeObject(java.io.ObjectOutputStream oos) throws 
IOException {
+         // we need to write a resolved InetSocketAddress to keep old readers 
happy
+         ncAddress = new InetSocketAddress(ncPort.getAddress(), 
ncPort.getPort());
+         oos.defaultWriteObject();
+     }
  }

Reply via email to