Permalink
Browse files

Remove old twittertopiccount example

  • Loading branch information...
1 parent 7aaba95 commit 02dca79e607f3b2bfe20b7c9c40330d9f457fb56 Bruce Robbins committed Jul 15, 2011
View
@@ -63,7 +63,7 @@ Running the Twitter Topic Count Example
git clone https://github.com/s4/s4.git
# Create image
-gradlew allImage
+./gradlew allImage
# set the S4_IMAGE environmental variable
cd build/s4-image/
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2010 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.
- */
-dependencies {
- compile( libraries.json )
- compile( libraries.commons_codec )
- compile( libraries.commons_httpclient )
- compile project(':s4-core')
-}
-
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2010 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 io.s4.example.twittertopiccount;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import io.s4.persist.Persister;
-
-public class DirectToFilePersister implements Persister {
- private String outputFilename;
- private int persistCount;
-
- public void setOutputFilename(String outputFilename) {
- this.outputFilename = outputFilename;
- }
-
- @Override
- public int cleanOutGarbage() throws InterruptedException {
- return 0;
- }
-
- @Override
- public Object get(String arg0) throws InterruptedException {
- return null;
- }
-
- @Override
- public Map<String, Object> getBulk(String[] arg0)
- throws InterruptedException {
- return new HashMap<String, Object>();
- }
-
- @Override
- public Map<String, Object> getBulkObjects(String[] arg0)
- throws InterruptedException {
- return new HashMap<String, Object>();
- }
-
- @Override
- public int getCacheEntryCount() {
- return 1;
- }
-
- @Override
- public Object getObject(String arg0) throws InterruptedException {
- return null;
- }
-
- @Override
- public int getPersistCount() {
- return persistCount;
- }
-
- @Override
- public int getQueueSize() {
- return 0;
- }
-
- @Override
- public Set<String> keySet() {
- return new HashSet<String>();
- }
-
- @Override
- public void remove(String arg0) throws InterruptedException {
-
- }
-
- @Override
- public void set(String key, Object value, int persistTime)
- throws InterruptedException {
-
- FileWriter fw = null;
- try {
- fw = new FileWriter(outputFilename);
- fw.write(String.valueOf(value));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- Logger.getLogger("s4").error(e);
- } finally {
- if (fw != null) {
- try {
- fw.close();
- } catch (Exception e) {
- }
- }
- }
- }
-
- @Override
- public void setAsynch(String key, Object value, int persistTime) {
- try {
- set(key, value, persistTime);
- } catch (InterruptedException ie) {
- }
- }
-
-}
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2010 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 io.s4.example.twittertopiccount;
-
-public class Status {
- private long id;
- private long inReplyToStatusId;
- private String text;
- private boolean truncated;
- private String source;
- private String inReplyToScreenName;
- private boolean favorited;
- private User user;
- private long inReplyToUserId;
- private String createdAt;
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public long getInReplyToStatusId() {
- return inReplyToStatusId;
- }
-
- public void setInReplyToStatusId(long inReplyToStatusId) {
- this.inReplyToStatusId = inReplyToStatusId;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public boolean isTruncated() {
- return truncated;
- }
-
- public void setTruncated(boolean truncated) {
- this.truncated = truncated;
- }
-
- public String getSource() {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public String getInReplyToScreenName() {
- return inReplyToScreenName;
- }
-
- public void setInReplyToScreenName(String inReplyToScreenName) {
- this.inReplyToScreenName = inReplyToScreenName;
- }
-
- public boolean isFavorited() {
- return favorited;
- }
-
- public void setFavorited(boolean favorited) {
- this.favorited = favorited;
- }
-
- public User getUser() {
- return user;
- }
-
- public void setUser(User user) {
- this.user = user;
- }
-
- public long getInReplyToUserId() {
- return inReplyToUserId;
- }
-
- public void setInReplyToUserId(long inReplyToUserId) {
- this.inReplyToUserId = inReplyToUserId;
- }
-
- public String getCreatedAt() {
- return createdAt;
- }
-
- public void setCreatedAt(String createdAt) {
- this.createdAt = createdAt;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("{")
- .append("id:")
- .append(id)
- .append(",")
- .append("inReplyToStatusId:")
- .append(inReplyToStatusId)
- .append(",")
- .append("text:")
- .append(text)
- .append(",")
- .append("truncated:")
- .append(truncated)
- .append(",")
- .append("source:")
- .append(source)
- .append(",")
- .append("inReplyToScreenName:")
- .append(inReplyToScreenName)
- .append(",")
- .append("favorited:")
- .append(favorited)
- .append(",")
- .append("user:")
- .append(user)
- .append(",")
- .append("inReplyToUserId:")
- .append(inReplyToUserId)
- .append(",")
- .append("createdAt:")
- .append(createdAt)
- .append("}");
-
- return sb.toString();
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException cnse) {
- throw new RuntimeException(cnse);
- }
- }
-}
Oops, something went wrong.

0 comments on commit 02dca79

Please sign in to comment.