From 9b207cd5d3dfeb6d6ac2f77ab11af663ca7df05d Mon Sep 17 00:00:00 2001 From: yuyanting <yuyantingzero@gmail.com> Date: Wed, 6 Apr 2016 15:49:59 -0700 Subject: [PATCH] [googledatastore] Address code review comments. --- googledatastore/pom.xml | 26 +------------------ .../yahoo/ycsb/db/GoogleDatastoreClient.java | 3 +++ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/googledatastore/pom.xml b/googledatastore/pom.xml index 8ddd1d9c..0f39aa3a 100644 --- a/googledatastore/pom.xml +++ b/googledatastore/pom.xml @@ -35,7 +35,7 @@ LICENSE file. <name>sonatype-snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> <snapshots> - <enabled>true</enabled> + <enabled>true</enabled> </snapshots> </repository> </repositories> @@ -62,28 +62,4 @@ LICENSE file. <scope>provided</scope> </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.15</version> - <configuration> - <consoleOutput>true</consoleOutput> - <configLocation>../checkstyle.xml</configLocation> - <failOnViolation>true</failOnViolation> - <failsOnError>false</failsOnError> - </configuration> - <executions> - <execution> - <id>validate</id> - <phase>validate</phase> - <goals> - <goal>checkstyle</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> </project> diff --git a/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java b/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java index 7077455d..a3f65534 100644 --- a/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java +++ b/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java @@ -242,6 +242,7 @@ public class GoogleDatastoreClient extends DB { @Override public Status update(String table, String key, HashMap<String, ByteIterator> values) { + return doSingleItemMutation(table, key, values, MutationType.UPDATE); } @@ -285,8 +286,10 @@ public class GoogleDatastoreClient extends DB { // for multi-item mutation, or Read-modify-write operation. CommitRequest.Builder commitRequest = CommitRequest.newBuilder(); commitRequest.setMode(Mode.NON_TRANSACTIONAL); + if (mutationType == MutationType.DELETE) { commitRequest.addMutationsBuilder().setDelete(datastoreKey); + } else { // If this is not for delete, build the entity. Entity.Builder entityBuilder = Entity.newBuilder(); -- GitLab