зеркало из https://github.com/Azure/YCSB.git
[cassandra cassandra2 dynamodb hbase098 hbase10 jdbc s3] Fixing squid:S1481 - Unused local variables should be removed
This commit is contained in:
Родитель
6032ff165b
Коммит
d3e1f368c6
|
@ -388,7 +388,7 @@ public class CassandraCQLClient extends DB {
|
|||
System.out.println(insertStmt.toString());
|
||||
}
|
||||
|
||||
ResultSet rs = session.execute(insertStmt);
|
||||
session.execute(insertStmt);
|
||||
|
||||
return Status.OK;
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -433,7 +433,7 @@ public class CassandraCQLClient extends DB {
|
|||
System.out.println(insertStmt.toString());
|
||||
}
|
||||
|
||||
ResultSet rs = session.execute(insertStmt);
|
||||
session.execute(insertStmt);
|
||||
|
||||
return Status.OK;
|
||||
} catch (Exception e) {
|
||||
|
@ -466,7 +466,7 @@ public class CassandraCQLClient extends DB {
|
|||
System.out.println(stmt.toString());
|
||||
}
|
||||
|
||||
ResultSet rs = session.execute(stmt);
|
||||
session.execute(stmt);
|
||||
|
||||
return Status.OK;
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -293,9 +293,8 @@ public class DynamoDBClient extends DB {
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -310,10 +309,9 @@ public class DynamoDBClient extends DB {
|
|||
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;
|
||||
|
|
|
@ -110,7 +110,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB
|
|||
try
|
||||
{
|
||||
HTable ht = new HTable(config, table);
|
||||
HTableDescriptor dsc = ht.getTableDescriptor();
|
||||
ht.getTableDescriptor();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.apache.hadoop.conf.Configuration;
|
|||
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;
|
||||
|
@ -142,8 +141,7 @@ public class HBaseClient10 extends com.yahoo.ycsb.DB {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ public class JdbcDBClientTest {
|
|||
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)
|
||||
|
@ -245,7 +245,7 @@ public class JdbcDBClientTest {
|
|||
@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>();
|
||||
|
||||
|
|
|
@ -361,8 +361,7 @@ public class S3Client extends DB {
|
|||
getObjectMetadataRequest = new GetObjectMetadataRequest(bucket,
|
||||
key);
|
||||
}
|
||||
S3Object object =
|
||||
s3Client.getObject(getObjectRequest);
|
||||
s3Client.getObject(getObjectRequest);
|
||||
ObjectMetadata objectMetadata =
|
||||
s3Client.getObjectMetadata(getObjectMetadataRequest);
|
||||
int sizeOfFile = (int)objectMetadata.getContentLength();
|
||||
|
|
Загрузка…
Ссылка в новой задаче