diff src/main/java/christie/topology/node/PrepareToClose.java @ 49:fd944876257b

add node and keepalive
author akahori
date Thu, 23 Aug 2018 09:29:05 +0900
parents
children 76b6da075ce0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/christie/topology/node/PrepareToClose.java	Thu Aug 23 09:29:05 2018 +0900
@@ -0,0 +1,46 @@
+package christie.topology.node;
+
+
+import christie.annotation.Peek;
+import christie.annotation.Take;
+import christie.codegear.CodeGear;
+import christie.codegear.CodeGearManager;
+
+import java.util.List;
+
+public class PrepareToClose extends CodeGear {
+
+    @Peek
+    String _CLOSEMESSEAGE;
+
+    @Take
+    List<String> _CLIST;
+
+
+    public PrepareToClose() {
+
+    }
+
+    @Override
+    protected void run(CodeGearManager cgm) {
+        /*
+        if (_CLIST.contains(_CLOSEMESSEAGE)) {
+            _CLIST.remove(_CLOSEMESSEAGE);
+
+            DataSegmentManager manager = DataSegment.get(_CLOSEMESSEAGE);
+            manager.setSendError(false);
+
+            ods.put(_CLOSEMESSEAGE, "_CLOSEREADY", _CLOSEMESSEAGE);
+            ods.put("_CLOSEREADY", _CLOSEMESSEAGE);
+
+            new CloseRemoteDataSegment();
+        } else {
+            // lost node is this node's parent, so already removed
+            new ReceiveCloseMessage(CommandType.TAKE);
+        }*/
+        cgm.setup(new PrepareToClose());
+        getLocalDGM().put("_CLIST", _CLIST);
+
+    }
+
+}