You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/08/26 12:34:44 UTC

[11/16] ignite git commit: IGNITE-1303: Created PlatformContext abstraction.

IGNITE-1303: Created PlatformContext abstraction.


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

Branch: refs/heads/ignite-1124
Commit: 08be80ffee4b24506802cb22130903cb1e749873
Parents: ed974f3
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Aug 26 12:05:51 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Aug 26 12:05:51 2015 +0300

----------------------------------------------------------------------
 .../processors/platform/PlatformContext.java    | 107 +++++++++++++++++++
 1 file changed, 107 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/08be80ff/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
new file mode 100644
index 0000000..0385f46
--- /dev/null
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal.processors.platform;
+
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.portable.*;
+import org.apache.ignite.internal.processors.platform.callback.*;
+import org.apache.ignite.internal.processors.platform.memory.*;
+
+import java.util.*;
+
+/**
+ * Platform context. Acts as an entry point for platform operations.
+ */
+public interface PlatformContext {
+    /**
+     * Gets kernal context.
+     *
+     * @return Kernal context.
+     */
+    public GridKernalContext kernalContext();
+
+    /**
+     * Gets platform memory manager.
+     *
+     * @return Memory manager.
+     */
+    public PlatformMemoryManager memory();
+
+    /**
+     * Gets platform callback gateway.
+     *
+     * @return Callback gateway.
+     */
+    public PlatformCallbackGateway gateway();
+
+    /**
+     * Get memory reader.
+     *
+     * @param mem Memory.
+     * @return Reader.
+     */
+    public PortableRawReaderEx reader(PlatformMemory mem);
+
+    /**
+     * Get memory reader.
+     *
+     * @param in Input.
+     * @return Reader.
+     */
+    public PortableRawReaderEx reader(PlatformInputStream in);
+
+    /**
+     * Get memory writer.
+     *
+     * @param mem Memory.
+     * @return Writer.
+     */
+    public PortableRawWriterEx writer(PlatformMemory mem);
+
+    /**
+     * Get memory writer.
+     *
+     * @param out Output.
+     * @return Writer.
+     */
+    public PortableRawWriterEx writer(PlatformOutputStream out);
+
+    /**
+     * Sends node info to native platform, if necessary.
+     *
+     * @param node Node.
+     */
+    public void addNode(ClusterNode node);
+
+    /**
+     * Writes a node id to a stream and sends node info to native platform, if necessary.
+     *
+     * @param writer Writer.
+     * @param node Node.
+     */
+    public void writeNode(PortableRawWriterEx writer, ClusterNode node);
+
+    /**
+     * Writes multiple node ids to a stream and sends node info to native platform, if necessary.
+     *
+     * @param writer Writer.
+     * @param nodes Nodes.
+     */
+    public void writeNodes(PortableRawWriterEx writer, Collection<ClusterNode> nodes);
+}