You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2018/11/02 10:01:50 UTC

[avro] branch master updated: AVRO-2251 part 2: Allow changes to COUNT and CYCLES via system properties.

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 943411d  AVRO-2251 part 2: Allow changes to COUNT and CYCLES via system properties.
943411d is described below

commit 943411d20d27c9f11f9bd0311ae5c4438b7cc81c
Author: rstata <rs...@yahoo.com>
AuthorDate: Fri Nov 2 00:47:35 2018 -0700

    AVRO-2251 part 2: Allow changes to COUNT and CYCLES via system properties.
---
 lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
index ea6c4d3..8f525b4 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
@@ -52,8 +52,10 @@ import org.apache.avro.util.Utf8;
  * Avro encoding and decoding.
  */
 public class Perf {
-  private static final int COUNT = 250000; // needs to be a multiple of 4
-  private static final int CYCLES = 800;
+  private static final int COUNT // needs to be a multiple of 4
+    = Integer.parseInt(System.getProperty("org.apache.avro.io.perf.count","250000"));
+  private static final int CYCLES
+    = Integer.parseInt(System.getProperty("org.apache.avro.io.perf.cycles","800"));
 
   /**
    * Use a fixed value seed for random number generation
@@ -166,6 +168,11 @@ public class Perf {
   }
 
   public static void main(String[] args) throws Exception {
+    if (0 != (COUNT % 4)) {
+      System.out.println("Property 'org.apache.avro.io.perf.count' must be a multiple of 4.");
+      System.exit(1);
+    }
+
     List<Test> tests = new ArrayList<>();
     boolean writeTests = true;
     boolean readTests = true;