Skip to content

Commit 1de040e

Browse files
committed
---
yaml --- r: 4341 b: refs/heads/gcs-nio c: de30a25 h: refs/heads/master i: 4339: 308f77a
1 parent 3357b3c commit 1de040e

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ refs/tags/v0.0.12: 2fd8066e891fb3dfea69b65f6bf6461db79342b9
1111
refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
14-
refs/heads/gcs-nio: ba4fcf01983f61df06ab07734944c2408e6932f2
14+
refs/heads/gcs-nio: de30a254b7e9e994bbf87644f5a0a0bf41ed97f4
1515
refs/heads/logging-alpha: db5312bffa7fccac194f6a7feb8cc3066de16aff
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0

branches/gcs-nio/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ public static OperationListOption fields(OperationField... fields) {
10921092
Page<Operation> listZoneOperations(String zone, OperationListOption... options);
10931093

10941094
/**
1095-
* Deletes the requested operation.
1095+
* Deletes the requested operation. Delete is only possible for operations that have completed
1096+
* their execution. Any attempt to delete a running operation will fail.
10961097
*
10971098
* @return {@code true} if operation was deleted, {@code false} if it was not found
10981099
* @throws ComputeException upon failure

branches/gcs-nio/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,10 @@ public com.google.api.services.compute.model.Operation call() {
542542
ZoneOperationId zoneOperationId = (ZoneOperationId) operationId;
543543
return computeRpc.getZoneOperation(zoneOperationId.zone(),
544544
zoneOperationId.operation(), optionsMap);
545-
default:
545+
case GLOBAL:
546546
return computeRpc.getGlobalOperation(operationId.operation(), optionsMap);
547+
default:
548+
throw new IllegalArgumentException("Unexpected operation identity type");
547549
}
548550
}
549551
}, options().retryParams(), EXCEPTION_HANDLER);
@@ -670,8 +672,10 @@ public Boolean call() {
670672
ZoneOperationId zoneOperationId = (ZoneOperationId) operation;
671673
return computeRpc.deleteZoneOperation(zoneOperationId.zone(),
672674
zoneOperationId.operation());
673-
default:
675+
case GLOBAL:
674676
return computeRpc.deleteGlobalOperation(operation.operation());
677+
default:
678+
throw new IllegalArgumentException("Unexpected operation identity type");
675679
}
676680
}
677681
}, options().retryParams(), EXCEPTION_HANDLER);

branches/gcs-nio/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,8 @@ public Operation reload(Compute.OperationOption... options) throws ComputeExcept
692692
}
693693

694694
/**
695-
* Deletes this operation.
695+
* Deletes this operation. Delete is only possible for operations that have completed their
696+
* execution. Any attempt to delete a running operation will fail.
696697
*
697698
* @return {@code true} if operation was deleted, {@code false} if it was not found
698699
* @throws ComputeException upon failure

0 commit comments

Comments
 (0)