beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [1/2] incubator-beam git commit: StateTable: simplify with HashBasedTable.create()
Date Mon, 11 Jul 2016 19:41:43 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 77d928210 -> 1c5858b86


StateTable: simplify with HashBasedTable.create()


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/59f7e3dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/59f7e3dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/59f7e3dd

Branch: refs/heads/master
Commit: 59f7e3ddee1887e046ab3dbc4f3cf469c4ba36d9
Parents: 77d9282
Author: Dan Halperin <dhalperi@google.com>
Authored: Mon Jul 11 10:03:29 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Mon Jul 11 10:03:29 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/beam/sdk/util/state/StateTable.java | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/59f7e3dd/sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateTable.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateTable.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateTable.java
index 650ebb0..2ae6516 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateTable.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateTable.java
@@ -19,11 +19,9 @@ package org.apache.beam.sdk.util.state;
 
 import org.apache.beam.sdk.util.state.StateTag.StateBinder;
 
-import com.google.common.base.Supplier;
+import com.google.common.collect.HashBasedTable;
 import com.google.common.collect.Table;
-import com.google.common.collect.Tables;
 
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
@@ -33,13 +31,7 @@ import java.util.Set;
 public abstract class StateTable<K> {
 
   private final Table<StateNamespace, StateTag<? super K, ?>, State> stateTable
=
-      Tables.newCustomTable(new HashMap<StateNamespace, Map<StateTag<? super K,
?>, State>>(),
-          new Supplier<Map<StateTag<? super K, ?>, State>>() {
-        @Override
-        public Map<StateTag<? super K, ?>, State> get() {
-          return new HashMap<>();
-        }
-      });
+      HashBasedTable.create();
 
   /**
    * Gets the {@link State} in the specified {@link StateNamespace} with the specified {@link


Mime
View raw message