You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/10/29 15:13:24 UTC
[4/6] ignite git commit: IGNITE-1803: WIP.
IGNITE-1803: WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7e0741a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7e0741a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7e0741a
Branch: refs/heads/ignite-1803
Commit: a7e0741a1ee34072331304b000ff7183bc33d160
Parents: 3b4e63932
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Oct 29 17:11:02 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Oct 29 17:11:02 2015 +0300
----------------------------------------------------------------------
.../portable/PortableFIeldDescriptorImpl.java | 82 --------------------
.../portable/PortableFIeldDescriptorImpl2.java | 82 ++++++++++++++++++++
.../internal/portable/PortableObjectImpl.java | 2 +-
.../portable/PortableObjectOffheapImpl.java | 2 +-
4 files changed, 84 insertions(+), 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7e0741a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl.java
deleted file mode 100644
index 10fad1d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.portable;
-
-import org.apache.ignite.portable.PortableFieldDescriptor;
-import org.apache.ignite.portable.PortableObject;
-
-/**
- * Implementation of portable field descriptor.
- */
-public class PortableFIeldDescriptorImpl implements PortableFieldDescriptor {
- /** Well-known object schemas. */
- private final PortableSchemaRegistry schemas;
-
- /** Pre-calculated field ID. */
- private final int fieldId;
-
- /**
- * Constructor.
- *
- * @param schemas Schemas.
- * @param fieldId Field ID.
- */
- public PortableFIeldDescriptorImpl(PortableSchemaRegistry schemas, int fieldId) {
- this.schemas = schemas;
- this.fieldId = fieldId;
- }
-
- /** {@inheritDoc} */
- @Override public boolean exists(PortableObject obj) {
- PortableObjectEx obj0 = (PortableObjectEx)obj;
-
- return fieldOffset(obj0) != 0;
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public <T> T value(PortableObject obj) {
- PortableObjectEx obj0 = (PortableObjectEx)obj;
-
- int offset = fieldOffset(obj0);
-
- return offset != 0 ? (T)obj0.fieldByOffset(offset) : null;
- }
-
- /**
- * Get relative field offset.
- *
- * @param obj Object.
- * @return Field offset.
- */
- private int fieldOffset(PortableObjectEx obj) {
- int schemaId = obj.schemaId();
-
- PortableSchema schema = schemas.schema(schemaId);
-
- if (schema == null) {
- schema = obj.createSchema();
-
- schemas.addSchema(schemaId, schema);
- }
-
- assert schema != null;
-
- return schema.offset(fieldId);
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7e0741a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl2.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl2.java
new file mode 100644
index 0000000..0775b52
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableFIeldDescriptorImpl2.java
@@ -0,0 +1,82 @@
+/*
+ * 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.portable;
+
+import org.apache.ignite.portable.PortableFieldDescriptor;
+import org.apache.ignite.portable.PortableObject;
+
+/**
+ * Implementation of portable field descriptor.
+ */
+public class PortableFIeldDescriptorImpl2 implements PortableFieldDescriptor {
+ /** Well-known object schemas. */
+ private final PortableSchemaRegistry schemas;
+
+ /** Pre-calculated field ID. */
+ private final int fieldId;
+
+ /**
+ * Constructor.
+ *
+ * @param schemas Schemas.
+ * @param fieldId Field ID.
+ */
+ public PortableFIeldDescriptorImpl2(PortableSchemaRegistry schemas, int fieldId) {
+ this.schemas = schemas;
+ this.fieldId = fieldId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean exists(PortableObject obj) {
+ PortableObjectEx obj0 = (PortableObjectEx)obj;
+
+ return fieldOffset(obj0) != 0;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public <T> T value(PortableObject obj) {
+ PortableObjectEx obj0 = (PortableObjectEx)obj;
+
+ int offset = fieldOffset(obj0);
+
+ return offset != 0 ? (T)obj0.fieldByOffset(offset) : null;
+ }
+
+ /**
+ * Get relative field offset.
+ *
+ * @param obj Object.
+ * @return Field offset.
+ */
+ private int fieldOffset(PortableObjectEx obj) {
+ int schemaId = obj.schemaId();
+
+ PortableSchema schema = schemas.schema(schemaId);
+
+ if (schema == null) {
+ schema = obj.createSchema();
+
+ schemas.addSchema(schemaId, schema);
+ }
+
+ assert schema != null;
+
+ return schema.offset(fieldId);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7e0741a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectImpl.java
index 84cb812..897605b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectImpl.java
@@ -327,7 +327,7 @@ public final class PortableObjectImpl extends PortableObjectEx implements Extern
int fieldId = ctx.userTypeIdMapper(typeId).fieldId(typeId, fieldName);
- return new PortableFIeldDescriptorImpl(schemaReg, fieldId);
+ return new PortableFIeldDescriptorImpl2(schemaReg, fieldId);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7e0741a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectOffheapImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectOffheapImpl.java
index b6ffa59..b6e988b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectOffheapImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableObjectOffheapImpl.java
@@ -124,7 +124,7 @@ public class PortableObjectOffheapImpl extends PortableObjectEx implements Exter
int fieldId = ctx.userTypeIdMapper(typeId).fieldId(typeId, fieldName);
- return new PortableFIeldDescriptorImpl(schemaReg, fieldId);
+ return new PortableFIeldDescriptorImpl2(schemaReg, fieldId);
}
/** {@inheritDoc} */