Skip to content

Commit

Permalink
Reorder and add imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Mar 10, 2016
1 parent 407c436 commit fd7d84d
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

package com.google.gcloud.bigquery.spi;

import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.ALL_DATASETS;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.ALL_USERS;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.DELETE_CONTENTS;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.FIELDS;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.MAX_RESULTS;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.PAGE_TOKEN;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.START_INDEX;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.STATE_FILTER;
import static com.google.gcloud.bigquery.spi.BigQueryRpc.Option.TIMEOUT;
import static java.net.HttpURLConnection.HTTP_CREATED;
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
Expand Down Expand Up @@ -110,9 +113,10 @@ public Tuple<String, Iterable<Dataset>> listDatasets(Map<Option, ?> options) {
try {
DatasetList datasetsList = bigquery.datasets()
.list(this.options.projectId())
.setAll(Option.ALL_DATASETS.getBoolean(options))
.setAll(ALL_DATASETS.getBoolean(options))
.setMaxResults(MAX_RESULTS.getLong(options))
.setPageToken(PAGE_TOKEN.getString(options))
.setPageToken(PAGE_TOKEN.getString(options))
.execute();
Iterable<DatasetList.Datasets> datasets = datasetsList.getDatasets();
return Tuple.of(datasetsList.getNextPageToken(),
Expand Down Expand Up @@ -322,9 +326,9 @@ public Tuple<String, Iterable<Job>> listJobs(Map<Option, ?> options) {
try {
JobList jobsList = bigquery.jobs()
.list(this.options.projectId())
.setAllUsers(Option.ALL_USERS.getBoolean(options))
.setFields(Option.FIELDS.getString(options))
.setStateFilter(Option.STATE_FILTER.<List<String>>get(options))
.setAllUsers(ALL_USERS.getBoolean(options))
.setFields(FIELDS.getString(options))
.setStateFilter(STATE_FILTER.<List<String>>get(options))
.setMaxResults(MAX_RESULTS.getLong(options))
.setPageToken(PAGE_TOKEN.getString(options))
.setProjection(DEFAULT_PROJECTION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import com.google.gcloud.datastore.testing.LocalGcdHelper;
import com.google.gcloud.datastore.spi.DatastoreRpc;
import com.google.gcloud.datastore.spi.DatastoreRpcFactory;
import com.google.gcloud.datastore.testing.LocalGcdHelper;

import org.easymock.EasyMock;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
import com.google.gcloud.datastore.StructuredQuery.OrderBy;
import com.google.gcloud.datastore.StructuredQuery.Projection;
import com.google.gcloud.datastore.StructuredQuery.PropertyFilter;
import com.google.gcloud.datastore.testing.LocalGcdHelper;
import com.google.gcloud.datastore.spi.DatastoreRpc;
import com.google.gcloud.datastore.spi.DatastoreRpcFactory;
import com.google.gcloud.datastore.testing.LocalGcdHelper;
import com.google.protobuf.ByteString;

import org.easymock.EasyMock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.gcloud.AuthCredentials.ServiceAccountAuthCredentials;
import com.google.gcloud.ReadChannel;
import com.google.gcloud.WriteChannel;
import com.google.gcloud.storage.spi.StorageRpc.Tuple;
import com.google.gcloud.storage.Blob;
import com.google.gcloud.storage.BlobId;
import com.google.gcloud.storage.BlobInfo;
Expand All @@ -31,6 +30,7 @@
import com.google.gcloud.storage.Storage.CopyRequest;
import com.google.gcloud.storage.Storage.SignUrlOption;
import com.google.gcloud.storage.StorageOptions;
import com.google.gcloud.storage.spi.StorageRpc.Tuple;

import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.google.gcloud.resourcemanager.spi;

import static com.google.gcloud.resourcemanager.spi.ResourceManagerRpc.Option.FIELDS;
import static com.google.gcloud.resourcemanager.spi.ResourceManagerRpc.Option.FILTER;
import static com.google.gcloud.resourcemanager.spi.ResourceManagerRpc.Option.PAGE_SIZE;
import static com.google.gcloud.resourcemanager.spi.ResourceManagerRpc.Option.PAGE_TOKEN;
import static java.net.HttpURLConnection.HTTP_FORBIDDEN;
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;

Expand Down Expand Up @@ -56,7 +60,7 @@ public Project get(String projectId, Map<Option, ?> options) {
try {
return resourceManager.projects()
.get(projectId)
.setFields(Option.FIELDS.getString(options))
.setFields(FIELDS.getString(options))
.execute();
} catch (IOException ex) {
ResourceManagerException translated = translate(ex);
Expand All @@ -74,10 +78,10 @@ public Tuple<String, Iterable<Project>> list(Map<Option, ?> options) {
try {
ListProjectsResponse response = resourceManager.projects()
.list()
.setFields(Option.FIELDS.getString(options))
.setFilter(Option.FILTER.getString(options))
.setPageSize(Option.PAGE_SIZE.getInt(options))
.setPageToken(Option.PAGE_TOKEN.getString(options))
.setFields(FIELDS.getString(options))
.setFilter(FILTER.getString(options))
.setPageSize(PAGE_SIZE.getInt(options))
.setPageToken(PAGE_TOKEN.getString(options))
.execute();
return Tuple.<String, Iterable<Project>>of(
response.getNextPageToken(), response.getProjects());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import static org.junit.Assert.fail;

import com.google.common.collect.ImmutableMap;
import com.google.gcloud.resourcemanager.testing.LocalResourceManagerHelper;
import com.google.gcloud.resourcemanager.spi.DefaultResourceManagerRpc;
import com.google.gcloud.resourcemanager.spi.ResourceManagerRpc;
import com.google.gcloud.resourcemanager.spi.ResourceManagerRpc.Tuple;
import com.google.gcloud.resourcemanager.testing.LocalResourceManagerHelper;

import org.junit.AfterClass;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import com.google.gcloud.resourcemanager.ResourceManager.ProjectField;
import com.google.gcloud.resourcemanager.ResourceManager.ProjectGetOption;
import com.google.gcloud.resourcemanager.ResourceManager.ProjectListOption;
import com.google.gcloud.resourcemanager.testing.LocalResourceManagerHelper;
import com.google.gcloud.resourcemanager.spi.ResourceManagerRpc;
import com.google.gcloud.resourcemanager.spi.ResourceManagerRpcFactory;
import com.google.gcloud.resourcemanager.testing.LocalResourceManagerHelper;

import org.easymock.EasyMock;
import org.junit.AfterClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
import com.google.common.base.Function;
import com.google.gcloud.ReadChannel;
import com.google.gcloud.WriteChannel;
import com.google.gcloud.storage.spi.StorageRpc;
import com.google.gcloud.storage.spi.StorageRpc.Tuple;
import com.google.gcloud.storage.Storage.BlobTargetOption;
import com.google.gcloud.storage.Storage.BlobWriteOption;
import com.google.gcloud.storage.Storage.CopyRequest;
import com.google.gcloud.storage.Storage.SignUrlOption;
import com.google.gcloud.storage.spi.StorageRpc;
import com.google.gcloud.storage.spi.StorageRpc.Tuple;

import java.io.IOException;
import java.io.ObjectInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.gcloud.Page;
import com.google.gcloud.storage.spi.StorageRpc;
import com.google.gcloud.storage.Storage.BlobGetOption;
import com.google.gcloud.storage.Storage.BucketTargetOption;
import com.google.gcloud.storage.spi.StorageRpc;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Loading

0 comments on commit fd7d84d

Please sign in to comment.