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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to