You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/08/27 11:16:40 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request #301: IGNITE-15382 Decouple API and implementation for Tuple and Schema

AMashenkov opened a new pull request #301:
URL: https://github.com/apache/ignite-3/pull/301


   https://issues.apache.org/jira/browse/IGNITE-15382


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] agura commented on a change in pull request #301: IGNITE-15382 Decouple API and implementation for Tuple and Schema

Posted by GitBox <gi...@apache.org>.
agura commented on a change in pull request #301:
URL: https://github.com/apache/ignite-3/pull/301#discussion_r711091463



##########
File path: modules/api/src/main/java/org/apache/ignite/table/Tuple.java
##########
@@ -32,13 +34,18 @@
  * Provides specialized method for some value-types to avoid boxing/unboxing.
  */
 public interface Tuple extends Iterable<Object> {
+    /** Default factory. */
+    static TupleFactory FACTORY = ServiceLoader.load(TupleFactory.class)

Review comment:
       `static` is default for interfaces.

##########
File path: modules/api/src/main/java/org/apache/ignite/schema/SchemaBuilders.java
##########
@@ -34,6 +30,11 @@
  * Schema builder helper.

Review comment:
       As I can see it is public API, so javadocs are not descriptive enough.

##########
File path: modules/api/src/main/java/org/apache/ignite/table/Tuple.java
##########
@@ -365,4 +372,24 @@ static Tuple create(int capacity) {
      * @throws IndexOutOfBoundsException If column with given index doesn't exists.
      */
     Instant timestampValue(int columnIndex);
+
+    /**
+     * Tuple factory service interface.
+     */
+    interface TupleFactory {

Review comment:
       Could it be useful to have a method `create(Map<String, Object> cols)`?

##########
File path: modules/api/src/main/java/org/apache/ignite/schema/SchemaBuilders.java
##########
@@ -107,10 +106,75 @@ public static PartialIndexBuilder partialIndex(String name) {
      * @return Hash index builder.
      */
     public static HashIndexBuilder hashIndex(String name) {
-        return new HashIndexBuilderImpl(name);
+        return FACTORY.hashIndex(name);
     }
 
     // Stub.
     private SchemaBuilders() {
     }
+
+    /**
+     * Schema builders factory service interface.
+     */
+    public static interface SchemaBuilderFactory {

Review comment:
       As I can see it is public API, so javadocs are not descriptive enough.

##########
File path: modules/api/src/main/java/org/apache/ignite/schema/SchemaBuilders.java
##########
@@ -107,10 +106,75 @@ public static PartialIndexBuilder partialIndex(String name) {
      * @return Hash index builder.
      */
     public static HashIndexBuilder hashIndex(String name) {
-        return new HashIndexBuilderImpl(name);
+        return FACTORY.hashIndex(name);
     }
 
     // Stub.
     private SchemaBuilders() {
     }
+
+    /**
+     * Schema builders factory service interface.
+     */
+    public static interface SchemaBuilderFactory {

Review comment:
       What is a `static` interface? This modifier is redundant.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] agura commented on pull request #301: IGNITE-15382 Decouple API and implementation for Tuple and Schema

Posted by GitBox <gi...@apache.org>.
agura commented on pull request #301:
URL: https://github.com/apache/ignite-3/pull/301#issuecomment-921873529


   In general it looks good to me. But is it possible to avoid using of `ServiceLoader` for `TupleFactory` and `SchemaBuilder`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov merged pull request #301: IGNITE-15382 Decouple API and implementation for Tuple

Posted by GitBox <gi...@apache.org>.
AMashenkov merged pull request #301:
URL: https://github.com/apache/ignite-3/pull/301


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org