Skip to content

Commit

Permalink
Merge pull request brianfrankcooper#557 from DevFactory/staging/unuse…
Browse files Browse the repository at this point in the history
…d-local-variables-should-be-removed-fix-5

Unused local variables should be removed
  • Loading branch information
busbey committed Dec 31, 2015
2 parents 3442025 + d3e1f36 commit 44d8cad
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public Status insert(String table, String key,
System.out.println(insertStmt.toString());
}

ResultSet rs = session.execute(insertStmt);
session.execute(insertStmt);

return Status.OK;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public Status insert(String table, String key,
System.out.println(insertStmt.toString());
}

ResultSet rs = session.execute(insertStmt);
session.execute(insertStmt);

return Status.OK;
} catch (Exception e) {
Expand Down Expand Up @@ -466,7 +466,7 @@ public Status delete(String table, String key) {
System.out.println(stmt.toString());
}

ResultSet rs = session.execute(stmt);
session.execute(stmt);

return Status.OK;
} catch (Exception e) {
Expand Down
6 changes: 2 additions & 4 deletions dynamodb/src/main/java/com/yahoo/ycsb/db/DynamoDBClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,8 @@ public Status insert(String table, String key,HashMap<String, ByteIterator> valu
}

PutItemRequest putItemRequest = new PutItemRequest(table, attributes);
PutItemResult res = null;
try {
res = dynamoDB.putItem(putItemRequest);
dynamoDB.putItem(putItemRequest);
}catch (AmazonServiceException ex) {
logger.error(ex.getMessage());
return Status.ERROR;
Expand All @@ -310,10 +309,9 @@ public Status insert(String table, String key,HashMap<String, ByteIterator> valu
public Status delete(String table, String key) {
logger.debug("deletekey: " + key + " from table: " + table);
DeleteItemRequest req = new DeleteItemRequest(table, createPrimaryKey(key));
DeleteItemResult res = null;

try {
res = dynamoDB.deleteItem(req);
dynamoDB.deleteItem(req);
}catch (AmazonServiceException ex) {
logger.error(ex.getMessage());
return Status.ERROR;
Expand Down
2 changes: 1 addition & 1 deletion hbase098/src/main/java/com/yahoo/ycsb/db/HBaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void init() throws DBException
try
{
HTable ht = new HTable(config, table);
HTableDescriptor dsc = ht.getTableDescriptor();
ht.getTableDescriptor();
}
catch (IOException e)
{
Expand Down
4 changes: 1 addition & 3 deletions hbase10/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.BufferedMutator;
import org.apache.hadoop.hbase.client.BufferedMutatorParams;
Expand Down Expand Up @@ -142,8 +141,7 @@ public void init() throws DBException {
String table = com.yahoo.ycsb.workloads.CoreWorkload.table;
try {
final TableName tName = TableName.valueOf(table);
HTableDescriptor dsc =
connection.getTable(tName).getTableDescriptor();
connection.getTable(tName).getTableDescriptor();
} catch (IOException e) {
throw new DBException(e);
}
Expand Down
4 changes: 2 additions & 2 deletions jdbc/src/test/java/com/yahoo/ycsb/db/JdbcDBClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private HashMap<String, ByteIterator> insertRow(String insertKey) {
public void insertTest() {
try {
String insertKey = "user0";
HashMap<String, ByteIterator> insertMap = insertRow(insertKey);
insertRow(insertKey);

ResultSet resultSet = jdbcConnection.prepareStatement(
String.format("SELECT * FROM %s", TABLE_NAME)
Expand Down Expand Up @@ -245,7 +245,7 @@ public void updateTest() {
@Test
public void readTest() {
String insertKey = "user0";
HashMap<String, ByteIterator> insertMap = insertRow(insertKey);
insertRow(insertKey);
HashSet<String> readFields = new HashSet<String>();
HashMap<String, ByteIterator> readResultMap = new HashMap<String, ByteIterator>();

Expand Down
3 changes: 1 addition & 2 deletions s3/src/main/java/com/yahoo/ycsb/db/S3Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ protected Status writeToStorage(String bucket, String key,
getObjectMetadataRequest = new GetObjectMetadataRequest(bucket,
key);
}
S3Object object =
s3Client.getObject(getObjectRequest);
s3Client.getObject(getObjectRequest);
ObjectMetadata objectMetadata =
s3Client.getObjectMetadata(getObjectMetadataRequest);
int sizeOfFile = (int)objectMetadata.getContentLength();
Expand Down

0 comments on commit 44d8cad

Please sign in to comment.