incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [2/50] [abbrv] git commit: Implemented GenericKeyFinder to specify event fields of primitive types as strings OR event attribute keys as strings. Supported in the std and fluent APIs.
Date Tue, 03 Jan 2012 14:03:28 GMT
Implemented GenericKeyFinder to specify event fields of primitive types as strings OR event
attribute keys as strings. Supported in the std and fluent APIs.


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

Branch: refs/heads/piper
Commit: e228a8aeb423feba5d58a24fb160c63c6ac8efca
Parents: 5a173e7
Author: Leo Neumeyer <leo@s4.io>
Authored: Mon Dec 19 13:52:39 2011 -0800
Committer: Leo Neumeyer <leo@s4.io>
Committed: Mon Dec 19 13:52:39 2011 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/s4/base/Event.java    |   34 ++++++
 .../java/org/apache/s4/base/GenericKeyFinder.java  |   82 +++++++++++++++
 .../src/main/java/org/apache/s4/base/Key.java      |   50 +++++++++
 .../main/java/org/apache/s4/base/KeyFinder.java    |   29 +++++
 .../src/main/java/org/apache/s4/core/App.java      |    5 +-
 .../src/main/java/org/apache/s4/core/Key.java      |   51 ---------
 .../main/java/org/apache/s4/core/KeyFinder.java    |   30 ------
 .../src/main/java/org/apache/s4/core/Stream.java   |   28 ++++--
 .../main/java/org/apache/s4/fluent/AppMaker.java   |    9 ++-
 .../java/org/apache/s4/fluent/StreamMaker.java     |    4 +-
 .../org/apache/s4/base/EventAttributeTest.java     |   41 +++++++-
 .../test/java/org/apache/s4/base/SimpleEvent.java  |    8 ++-
 .../org/apache/s4/fluent/DurationKeyFinder.java    |    2 +-
 .../java/org/apache/s4/fluent/HeightKeyFinder.java |    2 +-
 .../java/org/apache/s4/fluent/QueryKeyFinder.java  |    2 +-
 .../org/apache/s4/wordcount/KeyValueKeyFinder.java |    2 +-
 .../org/apache/s4/wordcount/SentenceKeyFinder.java |    2 +-
 .../apache/s4/wordcount/WordCountKeyFinder.java    |    2 +-
 .../org/apache/s4/wordcount/WordSeenKeyFinder.java |    2 +-
 .../apache/s4/example/counter/AgeKeyFinder.java    |    3 +-
 .../apache/s4/example/counter/CountKeyFinder.java  |    2 +-
 .../apache/s4/example/counter/GenderKeyFinder.java |    3 +-
 .../java/org/apache/s4/example/counter/MyApp.java  |    4 +-
 .../apache/s4/example/counter/UserIDKeyFinder.java |    4 +-
 .../s4/example/fluent/counter/AgeKeyFinder.java    |    3 +-
 .../s4/example/fluent/counter/CountKeyFinder.java  |    2 +-
 .../s4/example/fluent/counter/GenderKeyFinder.java |    3 +-
 .../org/apache/s4/example/fluent/counter/Main.java |    2 +-
 .../s4/example/fluent/counter/UserIDKeyFinder.java |    3 +-
 .../apache/s4/example/model/ClassIDKeyFinder.java  |    3 +-
 .../apache/s4/example/model/HypIDKeyFinder.java    |    3 +-
 .../apache/s4/example/model/ObsIndexKeyFinder.java |    3 +-
 .../apache/s4/example/model/ResultKeyFinder.java   |    5 +-
 33 files changed, 300 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-base/src/main/java/org/apache/s4/base/Event.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-base/src/main/java/org/apache/s4/base/Event.java b/subprojects/s4-base/src/main/java/org/apache/s4/base/Event.java
index dbbb594..0a71e29 100644
--- a/subprojects/s4-base/src/main/java/org/apache/s4/base/Event.java
+++ b/subprojects/s4-base/src/main/java/org/apache/s4/base/Event.java
@@ -132,6 +132,40 @@ public class Event {
         return (T) data.value;
     }
 
+    /**
+     * Returns the value for key as a String.
+     * 
+     * @param key
+     * @return the value as a string.
+     */
+    public String get(String key) {
+
+        Data<?> data = map.get(key);
+
+        return String.valueOf(data.value);
+    }
+
+    public boolean hasAttributes() {
+
+        return map != null;
+    }
+
+    public boolean containsKey(String key) {
+        return map.containsKey(key);
+    }
+
+    public Map<String, String> getAttributesAsMap() {
+
+        Map<String, String> amap = Maps.newHashMap();
+
+        for (Map.Entry<String, Data<?>> entry : map.entrySet()) {
+            String key = entry.getKey();
+            String value = String.valueOf(entry.getValue().value);
+            amap.put(key, value);
+        }
+        return amap;
+    }
+
     /* Helper data object. */
     private class Data<T> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-base/src/main/java/org/apache/s4/base/GenericKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-base/src/main/java/org/apache/s4/base/GenericKeyFinder.java b/subprojects/s4-base/src/main/java/org/apache/s4/base/GenericKeyFinder.java
new file mode 100644
index 0000000..725452b
--- /dev/null
+++ b/subprojects/s4-base/src/main/java/org/apache/s4/base/GenericKeyFinder.java
@@ -0,0 +1,82 @@
+package org.apache.s4.base;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Use introspection on the target Event to create the key finder. The search for the key
is as follows:
+ * 
+ * <p>
+ * <ul>
+ * <li>If the event object class extends {@link Event}, find a field that matches the
key name.
+ * <li>If there is no match and the {@link Event} class has arbitrary attributes, search
for the key.
+ * <li>Otherwise, fail.
+ * </ul>
+ * 
+ * 
+ * @param <T>
+ */
+public class GenericKeyFinder<T extends Event> implements KeyFinder<T> {
+
+    private static final Logger logger = LoggerFactory.getLogger(GenericKeyFinder.class);
+
+    final private String keyName;
+    private Class<T> eventType;
+    private Field field;
+
+    public GenericKeyFinder(String keyName, Class<T> eventType) throws SecurityException
{
+        this.keyName = keyName;
+        this.eventType = eventType;
+
+        logger.debug("Creating a generic key finder for key [{}] with event type [{}].",
keyName, eventType.getName());
+        field = getField();
+    }
+
+    @Override
+    public List<String> get(T event) {
+
+        List<String> list = Lists.newArrayList();
+
+        if (field != null) {
+
+            try {
+                list.add(String.valueOf(field.get(event)));
+            } catch (IllegalArgumentException e) {
+                logger.error("Unable to access field [{}] in event of type [{}].", field.getName(),
eventType.getName());
+                throw e;
+            } catch (IllegalAccessException e) {
+                logger.error("Could not access field.", e);
+                return null;
+            }
+
+        } else {
+            list.add(event.get(keyName));
+        }
+        return list;
+    }
+
+    private Field getField() throws SecurityException {
+
+        Field f;
+
+        /* Find a field with name keyName. */
+        try {
+            f = eventType.getDeclaredField(keyName);
+            logger.debug("Found field [{}] of type [{}].", f.getName(), f.getType());
+
+            f.setAccessible(true);
+            return f;
+        } catch (NoSuchFieldException e) {
+
+            logger.debug(
+                    "Field [{}] could not be found in class [{}]. I will check if this is
an Event attribute at run-time.",
+                    keyName, eventType.getName());
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-base/src/main/java/org/apache/s4/base/Key.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-base/src/main/java/org/apache/s4/base/Key.java b/subprojects/s4-base/src/main/java/org/apache/s4/base/Key.java
new file mode 100644
index 0000000..8ce8f3e
--- /dev/null
+++ b/subprojects/s4-base/src/main/java/org/apache/s4/base/Key.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
+ * 
+ * Licensed 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. See accompanying LICENSE file. 
+ */
+package org.apache.s4.base;
+
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+
+/*
+ * The Key class is used to get the value of the key on a specific type of
+ * event. This is done to abstract all the complexity required to get the 
+ * value. The method for getting the value is implemented in a method of 
+ * an object of type KeyFinder<T>.
+ * 
+ * The application programmer provides the events and the corresponding 
+ * finders. The framework will use it to key on events.
+ */
+public class Key<T extends Event> {
+
+    final private KeyFinder<T> finder;
+    final private String separator;
+
+    public Key(KeyFinder<T> finder, String separator) {
+        this.finder = finder;
+        this.separator = separator;
+    }
+
+    public List<String> getList(T event) {
+        return finder.get(event);
+    }
+
+    public String get(T event) {
+        List<String> keys = getList(event);
+
+        return StringUtils.join(keys, separator);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-base/src/main/java/org/apache/s4/base/KeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-base/src/main/java/org/apache/s4/base/KeyFinder.java b/subprojects/s4-base/src/main/java/org/apache/s4/base/KeyFinder.java
new file mode 100644
index 0000000..48456e1
--- /dev/null
+++ b/subprojects/s4-base/src/main/java/org/apache/s4/base/KeyFinder.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
+ * 
+ * Licensed 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. See accompanying LICENSE file. 
+ */
+package org.apache.s4.base;
+
+import java.util.List;
+
+
+/*  
+ * The KeyFinder returns a list with one or more String values 
+ * (One value for single keys, and more than one value for 
+ * composite keys.) 
+ * */
+abstract public interface KeyFinder<T extends Event> {
+
+    public List<String> get(T event);
+}

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/core/App.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/App.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/App.java
index 6468ac4..7f04f2c 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/App.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/App.java
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.s4.base.Event;
+import org.apache.s4.base.KeyFinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -301,7 +302,9 @@ public abstract class App {
      */
     public <T extends Event> Stream<T> createStream(Class<T> type) {
 
-        return new Stream<T>(this);
+        Stream<T> stream = new Stream<T>(this);
+        stream.setEventType(type);
+        return stream;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/core/Key.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/Key.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/Key.java
deleted file mode 100644
index 16dea3c..0000000
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/Key.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
- * 
- * Licensed 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. See accompanying LICENSE file. 
- */
-package org.apache.s4.core;
-
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.s4.base.Event;
-
-/*
- * The Key class is used to get the value of the key on a specific type of
- * event. This is done to abstract all the complexity required to get the 
- * value. The method for getting the value is implemented in a method of 
- * an object of type KeyFinder<T>.
- * 
- * The application programmer provides the events and the corresponding 
- * finders. The framework will use it to key on events.
- */
-public class Key<T extends Event> {
-
-    final private KeyFinder<T> finder;
-    final private String separator;
-
-    public Key(KeyFinder<T> finder, String separator) {
-        this.finder = finder;
-        this.separator = separator;
-    }
-
-    public List<String> getList(T event) {
-        return finder.get(event);
-    }
-
-    public String get(T event) {
-        List<String> keys = getList(event);
-
-        return StringUtils.join(keys, separator);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/core/KeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/KeyFinder.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/KeyFinder.java
deleted file mode 100644
index 504e09f..0000000
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/KeyFinder.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
- * 
- * Licensed 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. See accompanying LICENSE file. 
- */
-package org.apache.s4.core;
-
-import java.util.List;
-
-import org.apache.s4.base.Event;
-
-/*  
- * The KeyFinder returns a list with one or more String values 
- * (One value for single keys, and more than one value for 
- * composite keys.) 
- * */
-abstract public interface KeyFinder<T extends Event> {
-
-    public List<String> get(T event);
-}

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/core/Stream.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/Stream.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/Stream.java
index 7420063..c05d81f 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/Stream.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/Stream.java
@@ -21,9 +21,13 @@ import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
 
 import org.apache.s4.base.Event;
+import org.apache.s4.base.GenericKeyFinder;
+import org.apache.s4.base.Key;
+import org.apache.s4.base.KeyFinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
 
 /**
@@ -50,6 +54,7 @@ public class Stream<T extends Event> extends Streamable<T> implements
Runnable {
     final private Receiver receiver;
     final private int id;
     final private App app;
+    private Class<T> eventType = null;
 
     /**
      * Send events using a {@link KeyFinder<T>}. The key finder extracts the value
of the key which is used to determine
@@ -101,7 +106,7 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
      * 
      * @param name
      *            the stream name, default is an empty string.
-     * @return the stream maker object
+     * @return the stream object
      */
     public Stream<T> setName(String name) {
         this.name = name;
@@ -113,7 +118,7 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
      * 
      * @param keyFinder
      *            a function to lookup the value of the key.
-     * @return the stream maker object
+     * @return the stream object
      */
     public Stream<T> setKey(KeyFinder<T> keyFinder) {
         this.key = new Key<T>(keyFinder, DEFAULT_SEPARATOR);
@@ -124,10 +129,15 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
      * Define the key finder for this stream using a descriptor.
      * 
      * @param keyFinderString
-     *            a descriptor to lookup the value of the key.
-     * @return the stream maker object
+     *            a descriptor to lookup up the value of the key.
+     * @return the stream object
      */
-    public Stream<T> setKey(String keyFinderString) {
+    public Stream<T> setKey(String keyName) {
+
+        Preconditions.checkNotNull(eventType);
+
+        KeyFinder<T> kf = new GenericKeyFinder<T>(keyName, eventType);
+        setKey(kf);
 
         return this;
     }
@@ -138,7 +148,7 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
      * @param pe
      *            a target PE.
      * 
-     * @return the stream maker object
+     * @return the stream object
      */
     public Stream<T> setPE(ProcessingElement pe) {
         app.addStream(this, pe);
@@ -151,7 +161,7 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
      * @param pe
      *            a target PE array.
      * 
-     * @return the stream maker object
+     * @return the stream object
      */
     public Stream<T> setPEs(ProcessingElement[] pes) {
         for (int i = 0; i < pes.length; i++)
@@ -270,6 +280,10 @@ public class Stream<T extends Event> extends Streamable<T>
implements Runnable {
         return receiver;
     }
 
+    void setEventType(Class<T> type) {
+        this.eventType = type;
+    }
+
     @Override
     public void run() {
         while (true) {

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/fluent/AppMaker.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/fluent/AppMaker.java b/subprojects/s4-core/src/main/java/org/apache/s4/fluent/AppMaker.java
index d0a3f3f..bfeabd1 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/fluent/AppMaker.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/fluent/AppMaker.java
@@ -9,8 +9,8 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.s4.base.Event;
+import org.apache.s4.base.KeyFinder;
 import org.apache.s4.core.App;
-import org.apache.s4.core.KeyFinder;
 import org.apache.s4.core.ProcessingElement;
 import org.apache.s4.core.Stream;
 import org.slf4j.Logger;
@@ -166,7 +166,12 @@ abstract public class AppMaker {
 
         Stream<T> stream = app.createStream(type);
         stream.setName(sm.getName());
-        stream.setKey((KeyFinder<T>) sm.getKeyFinder()); // TODO: how do we make this
safe?
+
+        if (sm.getKeyFinder() != null)
+            stream.setKey((KeyFinder<T>) sm.getKeyFinder());
+        else if (sm.getKeyDescriptor() != null)
+            stream.setKey(sm.getKeyDescriptor());
+
         return stream;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/main/java/org/apache/s4/fluent/StreamMaker.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/fluent/StreamMaker.java b/subprojects/s4-core/src/main/java/org/apache/s4/fluent/StreamMaker.java
index a6a26b0..3d3ea0e 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/fluent/StreamMaker.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/fluent/StreamMaker.java
@@ -1,7 +1,7 @@
 package org.apache.s4.fluent;
 
 import org.apache.s4.base.Event;
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 import org.apache.s4.core.Stream;
 
 import com.google.common.base.Preconditions;
@@ -61,7 +61,7 @@ public class StreamMaker {
      *            a descriptor to lookup the value of the key.
      * @return the stream maker.
      */
-    public StreamMaker withKey(String keyDescriptor) {
+    public StreamMaker onKey(String keyDescriptor) {
 
         this.keyDescriptor = keyDescriptor;
         return this;

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/base/EventAttributeTest.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/base/EventAttributeTest.java
b/subprojects/s4-core/src/test/java/org/apache/s4/base/EventAttributeTest.java
index b4ed181..51376bd 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/base/EventAttributeTest.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/base/EventAttributeTest.java
@@ -15,7 +15,7 @@ public class EventAttributeTest {
         Map<String, String> map = new HashMap<String, String>();
         map.put("snoopy", "dog");
 
-        SimpleEvent ev = new SimpleEvent("Hello");
+        SimpleEvent ev = new SimpleEvent("Hello", 28);
         ev.put("An Int", Integer.class, 33);
         ev.put("A String", String.class, "XXX");
         ev.put("A Map", Map.class, map);
@@ -24,4 +24,43 @@ public class EventAttributeTest {
         Assert.assertEquals(33, ev.get("An Int", Integer.class).intValue());
         Assert.assertEquals("dog", ev.get("A Map", Map.class).get("snoopy"));
     }
+
+    @Test
+    public void testGenericKeyFinder1() {
+
+        /* Try to get a field value and field exists. */
+
+        KeyFinder<? extends Event> kf = new GenericKeyFinder<SimpleEvent>("numGrapes",
SimpleEvent.class);
+
+        SimpleEvent ev = new SimpleEvent("Hello", 28);
+        @SuppressWarnings("unchecked")
+        Key<SimpleEvent> k = new Key<SimpleEvent>((KeyFinder<SimpleEvent>)
kf, "");
+        Assert.assertEquals("28", k.get(ev));
+
+    }
+
+    @Test
+    public void testGenericKeyFinder2() {
+
+        /* Try to get an attribute value. */
+
+        SimpleEvent ev = new SimpleEvent("Hello", 28);
+        ev.put("An Int", Integer.class, 33);
+        KeyFinder<? extends Event> kf = new GenericKeyFinder<SimpleEvent>("An
Int", SimpleEvent.class);
+        @SuppressWarnings("unchecked")
+        Key<SimpleEvent> k = new Key<SimpleEvent>((KeyFinder<SimpleEvent>)
kf, "");
+        Assert.assertEquals("33", k.get(ev));
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testGenericKeyFinder3() {
+
+        /* Try to get a field that doesn't exist. */
+        SimpleEvent ev = new SimpleEvent("Hello", 28);
+        KeyFinder<? extends Event> kf = new GenericKeyFinder<SimpleEvent>("doesnotexist",
SimpleEvent.class);
+        @SuppressWarnings("unchecked")
+        Key<SimpleEvent> k = new Key<SimpleEvent>((KeyFinder<SimpleEvent>)
kf, "");
+        Assert.assertNull(k.get(ev));
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/base/SimpleEvent.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/base/SimpleEvent.java b/subprojects/s4-core/src/test/java/org/apache/s4/base/SimpleEvent.java
index b1b2915..475b754 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/base/SimpleEvent.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/base/SimpleEvent.java
@@ -3,10 +3,12 @@ package org.apache.s4.base;
 public class SimpleEvent extends Event {
 
     private String name;
+    private long numGrapes;
 
-    public SimpleEvent(String name) {
+    public SimpleEvent(String name, long numGrapes) {
         super();
         this.name = name;
+        this.numGrapes = numGrapes;
     }
 
     /**
@@ -15,4 +17,8 @@ public class SimpleEvent extends Event {
     public String getName() {
         return name;
     }
+
+    public long getNumGrapes() {
+        return numGrapes;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/fluent/DurationKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/DurationKeyFinder.java
b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/DurationKeyFinder.java
index a62a9f1..c1831e5 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/DurationKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/DurationKeyFinder.java
@@ -3,7 +3,7 @@ package org.apache.s4.fluent;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class DurationKeyFinder implements KeyFinder<EventA> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/fluent/HeightKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/HeightKeyFinder.java b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/HeightKeyFinder.java
index daad556..4bf4afe 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/HeightKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/HeightKeyFinder.java
@@ -3,7 +3,7 @@ package org.apache.s4.fluent;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class HeightKeyFinder implements KeyFinder<EventA> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/fluent/QueryKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/QueryKeyFinder.java b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/QueryKeyFinder.java
index 5979a23..050427b 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/fluent/QueryKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/fluent/QueryKeyFinder.java
@@ -3,7 +3,7 @@ package org.apache.s4.fluent;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class QueryKeyFinder implements KeyFinder<EventB> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/KeyValueKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/KeyValueKeyFinder.java
b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/KeyValueKeyFinder.java
index 8ed767a..28ee8d5 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/KeyValueKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/KeyValueKeyFinder.java
@@ -4,7 +4,7 @@ package org.apache.s4.wordcount;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class KeyValueKeyFinder implements KeyFinder<KeyValueEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/SentenceKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/SentenceKeyFinder.java
b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/SentenceKeyFinder.java
index e565864..2401f70 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/SentenceKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/SentenceKeyFinder.java
@@ -4,7 +4,7 @@ package org.apache.s4.wordcount;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class SentenceKeyFinder implements KeyFinder<StringEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountKeyFinder.java
b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountKeyFinder.java
index 74c044c..695a915 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountKeyFinder.java
@@ -4,7 +4,7 @@ package org.apache.s4.wordcount;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class WordCountKeyFinder implements KeyFinder<WordCountEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordSeenKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordSeenKeyFinder.java
b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordSeenKeyFinder.java
index 676843d..b089dac 100644
--- a/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordSeenKeyFinder.java
+++ b/subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordSeenKeyFinder.java
@@ -4,7 +4,7 @@ package org.apache.s4.wordcount;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class WordSeenKeyFinder implements KeyFinder<WordSeenEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/AgeKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/AgeKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/AgeKeyFinder.java
index 179e4f1..b03ca5f 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/AgeKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/AgeKeyFinder.java
@@ -15,11 +15,10 @@
  */
 package org.apache.s4.example.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class AgeKeyFinder implements KeyFinder<UserEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/CountKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/CountKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/CountKeyFinder.java
index 5485c89..a3aa733 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/CountKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/CountKeyFinder.java
@@ -18,7 +18,7 @@ package org.apache.s4.example.counter;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class CountKeyFinder implements KeyFinder<CountEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/GenderKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/GenderKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/GenderKeyFinder.java
index 9075bb1..361d760 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/GenderKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/GenderKeyFinder.java
@@ -15,11 +15,10 @@
  */
 package org.apache.s4.example.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class GenderKeyFinder implements KeyFinder<UserEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/MyApp.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/MyApp.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/MyApp.java
index 51c7261..b5cf2b1 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/MyApp.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/MyApp.java
@@ -97,7 +97,9 @@ final public class MyApp extends App {
 
         Stream<UserEvent> genderStream = createStream(UserEvent.class);
         genderStream.setName("Gender Stream");
-        genderStream.setKey(new GenderKeyFinder());
+        /* It is possible to specify a field name of a primitive type as a string instead
of using a KeyFinder object. */
+        // genderStream.setKey(new GenderKeyFinder());
+        genderStream.setKey("gender");
         genderStream.setPE(genderCountPE);
 
         Stream<UserEvent> ageStream = createStream(UserEvent.class);

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/UserIDKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/UserIDKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/UserIDKeyFinder.java
index f36be3d..0cbef15 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/UserIDKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/counter/UserIDKeyFinder.java
@@ -15,12 +15,10 @@
  */
 package org.apache.s4.example.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
-
+import org.apache.s4.base.KeyFinder;
 public class UserIDKeyFinder implements KeyFinder<UserEvent> {
 
     public List<String> get(UserEvent event) {

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/AgeKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/AgeKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/AgeKeyFinder.java
index 2d772de..f8ee411 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/AgeKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/AgeKeyFinder.java
@@ -15,11 +15,10 @@
  */
 package org.apache.s4.example.fluent.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class AgeKeyFinder implements KeyFinder<UserEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/CountKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/CountKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/CountKeyFinder.java
index 2314696..8991ddd 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/CountKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/CountKeyFinder.java
@@ -18,7 +18,7 @@ package org.apache.s4.example.fluent.counter;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class CountKeyFinder implements KeyFinder<CountEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/GenderKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/GenderKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/GenderKeyFinder.java
index d7883c8..06875a6 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/GenderKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/GenderKeyFinder.java
@@ -15,11 +15,10 @@
  */
 package org.apache.s4.example.fluent.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class GenderKeyFinder implements KeyFinder<UserEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/Main.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/Main.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/Main.java
index b7b61e6..7c05836 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/Main.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/Main.java
@@ -83,7 +83,7 @@ final public class Main extends AppMaker {
         userCountPE.emit(CountEvent.class).onKey(new CountKeyFinder()).to(printPE);
 
         generateUserEventPE.emit(UserEvent.class).onKey(new AgeKeyFinder()).to(ageCountPE);
-        generateUserEventPE.emit(UserEvent.class).onKey(new GenderKeyFinder()).to(genderCountPE);
+        generateUserEventPE.emit(UserEvent.class).onKey("gender").to(genderCountPE);
         generateUserEventPE.emit(UserEvent.class).onKey(new UserIDKeyFinder()).to(userCountPE);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/UserIDKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/UserIDKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/UserIDKeyFinder.java
index 0fcb24c..dd81715 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/UserIDKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/fluent/counter/UserIDKeyFinder.java
@@ -15,11 +15,10 @@
  */
 package org.apache.s4.example.fluent.counter;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
+import org.apache.s4.base.KeyFinder;
 
 public class UserIDKeyFinder implements KeyFinder<UserEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ClassIDKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ClassIDKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ClassIDKeyFinder.java
index 885f9f3..ea3bf77 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ClassIDKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ClassIDKeyFinder.java
@@ -19,8 +19,7 @@ package org.apache.s4.example.model;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
-
+import org.apache.s4.base.KeyFinder;
 
 public class ClassIDKeyFinder implements KeyFinder<ObsEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/model/HypIDKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/HypIDKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/HypIDKeyFinder.java
index ecc3753..bf37a3a 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/HypIDKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/HypIDKeyFinder.java
@@ -19,8 +19,7 @@ package org.apache.s4.example.model;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
-
+import org.apache.s4.base.KeyFinder;
 
 public class HypIDKeyFinder implements KeyFinder<ObsEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ObsIndexKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ObsIndexKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ObsIndexKeyFinder.java
index 05fdde9..dc45975 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ObsIndexKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ObsIndexKeyFinder.java
@@ -3,8 +3,7 @@ package org.apache.s4.example.model;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
-
+import org.apache.s4.base.KeyFinder;
 
 public class ObsIndexKeyFinder implements KeyFinder<ObsEvent> {
 

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/e228a8ae/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ResultKeyFinder.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ResultKeyFinder.java
b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ResultKeyFinder.java
index 6d91d30..387d96c 100644
--- a/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ResultKeyFinder.java
+++ b/subprojects/s4-example/src/main/java/org/apache/s4/example/model/ResultKeyFinder.java
@@ -19,14 +19,13 @@ package org.apache.s4.example.model;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.s4.core.KeyFinder;
-
+import org.apache.s4.base.KeyFinder;
 
 public class ResultKeyFinder implements KeyFinder<ResultEvent> {
 
     @Override
     public List<String> get(ResultEvent event) {
-        
+
         List<String> results = new ArrayList<String>();
 
         /* Retrieve the user ID and add it to the list. */


Mime
View raw message