Skip to content

Commit

Permalink
Simplified Lambda functions
Browse files Browse the repository at this point in the history
  • Loading branch information
smoell committed Feb 21, 2018
1 parent c09b29c commit bf14046
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

import java.nio.ByteBuffer;

public class KinesisConsumerHandler implements RequestHandler<KinesisEvent, Void> {
public class KinesisConsumerHandler {

private DynamoDB dynamoDB;

public Void handleRequest(KinesisEvent kinesisEvent, Context context) {
public void handleRequest(KinesisEvent kinesisEvent, Context context) {

LambdaLogger logger = context.getLogger();

Expand Down Expand Up @@ -81,7 +81,7 @@ public Void handleRequest(KinesisEvent kinesisEvent, Context context) {
}
}

return null;
return;
}

private AmazonDynamoDB createDynamodbClient(final Region region) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
import static com.amazon.util.Constants.REDIS_HOST;
import static com.amazon.util.Constants.REDIS_PORT;

public class RedisUpdaterHandler implements RequestHandler<KinesisEvent, Void> {
public class RedisUpdaterHandler {

private Jedis jedis;
private Charset charset = Charset.forName("UTF-8");
private ObjectMapper mapper = new ObjectMapper();

@Override
public Void handleRequest(KinesisEvent kinesisEvent, Context context) {
public void handleRequest(KinesisEvent kinesisEvent, Context context) {

RedisUpdater redisUpdater = new RedisUpdater();
LambdaLogger logger = context.getLogger();
Expand All @@ -50,7 +49,7 @@ public Void handleRequest(KinesisEvent kinesisEvent, Context context) {

if (System.getenv(REDIS_HOST) == null) {
logger.log("Not Redis host specified");
return null;
return;
}
String redisHost = System.getenv(REDIS_HOST);
int redisPort = System.getenv(REDIS_PORT) == null ? 6379 : Integer.parseInt(System.getenv(REDIS_PORT));
Expand All @@ -77,7 +76,7 @@ public Void handleRequest(KinesisEvent kinesisEvent, Context context) {
}
}

return null;
return;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,4 @@ public void writeToRedisTest() {
exc.printStackTrace();
}
}


}

0 comments on commit bf14046

Please sign in to comment.