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/01/22 10:57:47 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request #33: Table access API. Draft.

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


   Simple examples added.


----------------------------------------------------------------
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.

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



[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #33: IGNITE-14035: Table access API. Draft.

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/TableView.java
##########
@@ -0,0 +1,183 @@
+/*
+ * 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.table;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Table view interface.
+ *
+ * @param <R> Table row type.
+ */
+public interface TableView<R> {
+    /**
+     * Return row from table for given key fields.
+     *
+     * @param keyRec Row with key fields set.
+     * @return Row with all fields filled from the table.
+     */
+    public <K> R get(K keyRec);
+
+    /**
+     * Fills given rows with the values from the table.
+     *
+     * @param keyRecs Rows with key fields set.
+     * @return Rows with all fields filled from the table.
+     */
+    public <K> List<R> getAll(List<K> keyRecs);

Review comment:
       I think `List` interface is way too specific for the parameter, and may cause unnecessary conversions and allocations in user code.
   
   It would be great to accept `Iterable<K>` or at least `Collection<K>`.
   
   This applies to all APIs here and below.
   

##########
File path: modules/table/src/main/java/org/apache/ignite/internal/schema/marshaller/Marshaller.java
##########
@@ -0,0 +1,30 @@
+/*
+ * 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.schema.marshaller;
+
+import org.apache.ignite.table.binary.BinaryRow;
+
+public interface Marshaller {
+    <K> BinaryRow toKeyRow(K key);
+
+    <V> V unmarshallValue(BinaryRow row);

Review comment:
       `Marshal` is spelled with one `l`




----------------------------------------------------------------
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.

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



[GitHub] [ignite-3] AMashenkov merged pull request #33: IGNITE-14035: Table access API.

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


   


-- 
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.

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



[GitHub] [ignite-3] ptupitsyn commented on pull request #33: IGNITE-14035: Table access API. Draft.

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


   Tip: use draft PRs 
   https://github.blog/2019-02-14-introducing-draft-pull-requests/


----------------------------------------------------------------
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.

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