ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-7737: SQL COPY: renamed BUFFER_SIZE to PACKET_SIZE. This closes #3533.
Date Fri, 16 Feb 2018 14:54:33 GMT
Repository: ignite
Updated Branches:
  refs/heads/master b6d21fb7d -> f897370f8


IGNITE-7737: SQL COPY: renamed BUFFER_SIZE to PACKET_SIZE. This closes #3533.


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

Branch: refs/heads/master
Commit: f897370f88b12f7dbaffe4978d1dbc26e0a2516e
Parents: b6d21fb
Author: devozerov <vozerov@gridgain.com>
Authored: Fri Feb 16 17:54:24 2018 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Fri Feb 16 17:54:24 2018 +0300

----------------------------------------------------------------------
 .../thin/JdbcThinBulkLoadAbstractSelfTest.java  | 14 +++---
 .../internal/jdbc/thin/JdbcThinStatement.java   |  2 +-
 .../bulkload/BulkLoadAckClientParameters.java   | 48 ++++++++++----------
 .../odbc/jdbc/JdbcBulkLoadAckResult.java        |  6 +--
 .../apache/ignite/internal/sql/SqlKeyword.java  |  4 +-
 .../sql/command/SqlBulkLoadCommand.java         | 30 ++++++------
 .../query/h2/DmlStatementsProcessor.java        |  6 +--
 7 files changed, 55 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBulkLoadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBulkLoadAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBulkLoadAbstractSelfTest.java
index 761f700..e37abc4 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBulkLoadAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBulkLoadAbstractSelfTest.java
@@ -214,17 +214,17 @@ public abstract class JdbcThinBulkLoadAbstractSelfTest extends JdbcThinAbstractD
     }
 
     /**
-     * Imports two-entry CSV file with UTF-8 characters into a table using batch size of
one byte
+     * Imports two-entry CSV file with UTF-8 characters into a table using packet size of
one byte
      * (thus splitting each two-byte UTF-8 character into two batches)
      * and checks the created entries using SELECT statement.
      *
      * @throws SQLException If failed.
      */
-    public void testUtfBatchSize_1() throws SQLException {
+    public void testUtfPacketSize_1() throws SQLException {
         int updatesCnt = stmt.executeUpdate(
             "copy from \"" + BULKLOAD_UTF_CSV_FILE + "\" into " + TBL_NAME +
                 " (_key, age, firstName, lastName)" +
-                " format csv batch_size 1");
+                " format csv packet_size 1");
 
         assertEquals(2, updatesCnt);
 
@@ -388,13 +388,13 @@ public abstract class JdbcThinBulkLoadAbstractSelfTest extends JdbcThinAbstractD
     }
 
     /**
-     * Checks that bulk load works when we use batch size of 1 byte and thus
-     * create multiple batches per COPY.
+     * Checks that bulk load works when we use packet size of 1 byte and thus
+     * create multiple packetes per COPY.
      *
      * @throws SQLException If failed.
      */
-    public void testBatchSize_1() throws SQLException {
-        int updatesCnt = stmt.executeUpdate(BASIC_SQL_COPY_STMT + " batch_size 1");
+    public void testPacketSize_1() throws SQLException {
+        int updatesCnt = stmt.executeUpdate(BASIC_SQL_COPY_STMT + " packet_size 1");
 
         assertEquals(2, updatesCnt);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
index 2020011..9c41804 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
@@ -193,7 +193,7 @@ public class JdbcThinStatement implements Statement {
      */
     private JdbcResult sendFile(JdbcBulkLoadAckResult cmdRes) throws SQLException {
         String fileName = cmdRes.params().localFileName();
-        int batchSize = cmdRes.params().batchSize();
+        int batchSize = cmdRes.params().packetSize();
 
         int batchNum = 0;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadAckClientParameters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadAckClientParameters.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadAckClientParameters.java
index 119d9f9..5a8a859 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadAckClientParameters.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadAckClientParameters.java
@@ -23,33 +23,33 @@ import org.jetbrains.annotations.NotNull;
  * Bulk load parameters, which are parsed from SQL command and sent from server to client.
  */
 public class BulkLoadAckClientParameters {
-    /** Minimum batch size. */
-    public static final int MIN_BATCH_SIZE = 1;
+    /** Minimum packet size. */
+    public static final int MIN_PACKET_SIZE = 1;
 
     /**
-     * Maximum batch size. Note that the batch is wrapped to transport objects and the overall
packet should fit
+     * Maximum packet size. Note that the packet is wrapped to transport objects and the
overall packet should fit
      * into a Java array. 512 has been chosen arbitrarily.
      */
-    public static final int MAX_BATCH_SIZE = Integer.MAX_VALUE - 512;
+    public static final int MAX_PACKET_SIZE = Integer.MAX_VALUE - 512;
 
-    /** Size of a file batch for COPY command. */
-    public static final int DEFAULT_BATCH_SIZE = 4 * 1024 * 1024;
+    /** Size of a file packet size for COPY command. */
+    public static final int DFLT_PACKET_SIZE = 4 * 1024 * 1024;
 
     /** Local name of the file to send to server */
     @NotNull private final String locFileName;
 
-    /** File batch size in bytes. */
-    private final int batchSize;
+    /** File packet size in bytes. */
+    private final int packetSize;
 
     /**
      * Creates a bulk load parameters.
      *
      * @param locFileName File name to send from client to server.
-     * @param batchSize Batch size (Number of bytes in a portion of a file to send in one
JDBC request/response).
+     * @param packetSize Packet size (Number of bytes in a portion of a file to send in one
JDBC request/response).
      */
-    public BulkLoadAckClientParameters(@NotNull String locFileName, int batchSize) {
+    public BulkLoadAckClientParameters(@NotNull String locFileName, int packetSize) {
         this.locFileName = locFileName;
-        this.batchSize = batchSize;
+        this.packetSize = packetSize;
     }
 
     /**
@@ -62,31 +62,31 @@ public class BulkLoadAckClientParameters {
     }
 
     /**
-     * Returns the batch size.
+     * Returns the packet size.
      *
-     * @return The batch size.
+     * @return The packet size.
      */
-    public int batchSize() {
-        return batchSize;
+    public int packetSize() {
+        return packetSize;
     }
 
     /**
-     * Checks if batch size value is valid.
+     * Checks if packet size value is valid.
      *
-     * @param sz The batch size to check.
-     * @throws IllegalArgumentException if batch size is invalid.
+     * @param sz The packet size to check.
+     * @throws IllegalArgumentException if packet size is invalid.
      */
-    public static boolean isValidBatchSize(int sz) {
-        return sz >= MIN_BATCH_SIZE && sz <= MAX_BATCH_SIZE;
+    public static boolean isValidPacketSize(int sz) {
+        return sz >= MIN_PACKET_SIZE && sz <= MAX_PACKET_SIZE;
     }
 
     /**
-     * Creates proper batch size error message if {@link #isValidBatchSize(int)} check has
failed.
+     * Creates proper packet size error message if {@link #isValidPacketSize(int)} check
has failed.
      *
-     * @param sz The batch size.
+     * @param size The packet size.
      * @return The string with the error message.
      */
-    public static String batchSizeErrorMsg(int sz) {
-        return "Batch size should be within [" + MIN_BATCH_SIZE + ".." + MAX_BATCH_SIZE +
"]: " + sz;
+    public static String packetSizeErrorMesssage(int size) {
+        return "Packet size should be within [" + MIN_PACKET_SIZE + ".." + MAX_PACKET_SIZE
+ "]: " + size;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcBulkLoadAckResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcBulkLoadAckResult.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcBulkLoadAckResult.java
index 8a170ab..e670baf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcBulkLoadAckResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcBulkLoadAckResult.java
@@ -86,7 +86,7 @@ public class JdbcBulkLoadAckResult extends JdbcResult {
 
         writer.writeLong(qryId);
         writer.writeString(params.localFileName());
-        writer.writeInt(params.batchSize());
+        writer.writeInt(params.packetSize());
     }
 
     /** {@inheritDoc} */
@@ -98,8 +98,8 @@ public class JdbcBulkLoadAckResult extends JdbcResult {
         String locFileName = reader.readString();
         int batchSize = reader.readInt();
 
-        if (!BulkLoadAckClientParameters.isValidBatchSize(batchSize))
-            throw new BinaryObjectException(BulkLoadAckClientParameters.batchSizeErrorMsg(batchSize));
+        if (!BulkLoadAckClientParameters.isValidPacketSize(batchSize))
+            throw new BinaryObjectException(BulkLoadAckClientParameters.packetSizeErrorMesssage(batchSize));
 
         params = new BulkLoadAckClientParameters(locFileName, batchSize);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/core/src/main/java/org/apache/ignite/internal/sql/SqlKeyword.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/sql/SqlKeyword.java b/modules/core/src/main/java/org/apache/ignite/internal/sql/SqlKeyword.java
index 0238b01..9a2a865 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/sql/SqlKeyword.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/sql/SqlKeyword.java
@@ -42,8 +42,8 @@ public class SqlKeyword {
     /** Keyword: BOOL. */
     public static final String BOOL = "BOOL";
 
-    /** Keyword: BATCH_SIZE. */
-    public static final String BATCH_SIZE = "BATCH_SIZE";
+    /** Keyword: PACKET_SIZE. */
+    public static final String PACKET_SIZE = "PACKET_SIZE";
 
     /** Keyword: BOOLEAN. */
     public static final String BOOLEAN = "BOOLEAN";

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlBulkLoadCommand.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlBulkLoadCommand.java
b/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlBulkLoadCommand.java
index 4f065f2..444ebcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlBulkLoadCommand.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlBulkLoadCommand.java
@@ -53,8 +53,8 @@ public class SqlBulkLoadCommand implements SqlCommand {
     /** File format. */
     private BulkLoadFormat inputFormat;
 
-    /** Batch size (size of portion of a file sent in each sub-request). */
-    private Integer batchSize;
+    /** Packet size (size of portion of a file sent in each sub-request). */
+    private Integer packetSize;
 
     /**
      * Parses the command.
@@ -168,15 +168,15 @@ public class SqlBulkLoadCommand implements SqlCommand {
     private void parseParameters(SqlLexer lex) {
         while (lex.lookAhead().tokenType() == SqlLexerTokenType.DEFAULT) {
             switch (lex.lookAhead().token()) {
-                case SqlKeyword.BATCH_SIZE:
+                case SqlKeyword.PACKET_SIZE:
                     lex.shift();
 
-                    int sz = parseInt(lex);
+                    int size = parseInt(lex);
 
-                    if (!BulkLoadAckClientParameters.isValidBatchSize(sz))
-                        throw error(lex, BulkLoadAckClientParameters.batchSizeErrorMsg(sz));
+                    if (!BulkLoadAckClientParameters.isValidPacketSize(size))
+                        throw error(lex, BulkLoadAckClientParameters.packetSizeErrorMesssage(size));
 
-                    batchSize = sz;
+                    packetSize = size;
 
                     break;
 
@@ -255,21 +255,21 @@ public class SqlBulkLoadCommand implements SqlCommand {
     }
 
     /**
-     * Returns the batch size.
+     * Returns the packet size.
      *
-     * @return The batch size.
+     * @return The packet size.
      */
-    public Integer batchSize() {
-        return batchSize;
+    public Integer packetSize() {
+        return packetSize;
     }
 
     /**
-     * Sets the batch size.
+     * Sets the packet size.
      *
-     * @param batchSize The batch size.
+     * @param packetSize The packet size.
      */
-    public void batchSize(int batchSize) {
-        this.batchSize = batchSize;
+    public void packetSize(int packetSize) {
+        this.packetSize = packetSize;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/f897370f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
index 224bae0..ea6c7c1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
@@ -1011,8 +1011,8 @@ public class DmlStatementsProcessor {
      * @throws IgniteCheckedException If something failed.
      */
     public FieldsQueryCursor<List<?>> processBulkLoadCommand(SqlBulkLoadCommand
cmd) throws IgniteCheckedException {
-        if (cmd.batchSize() == null)
-            cmd.batchSize(BulkLoadAckClientParameters.DEFAULT_BATCH_SIZE);
+        if (cmd.packetSize() == null)
+            cmd.packetSize(BulkLoadAckClientParameters.DFLT_PACKET_SIZE);
 
         GridH2Table tbl = idx.dataTable(cmd.schemaName(), cmd.tableName());
 
@@ -1041,7 +1041,7 @@ public class DmlStatementsProcessor {
 
         BulkLoadProcessor processor = new BulkLoadProcessor(inputParser, dataConverter, outputWriter);
 
-        BulkLoadAckClientParameters params = new BulkLoadAckClientParameters(cmd.localFileName(),
cmd.batchSize());
+        BulkLoadAckClientParameters params = new BulkLoadAckClientParameters(cmd.localFileName(),
cmd.packetSize());
 
         return new BulkLoadContextCursor(processor, params);
     }


Mime
View raw message