1212 See the License for the specific language governing permissions and
1313 limitations under the License.
1414*/
15+
1516package com .google .cloud .bigquery .samples ;
1617
1718import com .google .api .client .json .GenericJson ;
@@ -44,7 +45,6 @@ public class BigqueryUtils {
4445 * static helper methods.
4546 */
4647 protected BigqueryUtils () {
47-
4848 }
4949
5050 /**
@@ -53,12 +53,11 @@ protected BigqueryUtils() {
5353 * @param out Output stream we want to print to
5454 */
5555 // [START print_rows]
56- public static void printRows (final List <TableRow > rows , final PrintStream
57- out ) {
56+ public static void printRows (final List <TableRow > rows , final PrintStream out ) {
5857 for (TableRow row : rows ) {
5958 for (TableCell field : row .getF ()) {
6059 out .printf ("%-50s" , field .getV ());
61- }
60+ }
6261 out .println ();
6362 }
6463 }
@@ -73,14 +72,13 @@ public static void printRows(final List<TableRow> rows, final PrintStream
7372 * @throws InterruptedException InterruptedException
7473 */
7574 // [START poll_job]
76- public static Job pollJob (final Bigquery .Jobs .Get request , final long
77- interval )
75+ public static Job pollJob (final Bigquery .Jobs .Get request , final long interval )
7876 throws IOException , InterruptedException {
7977 Job job = request .execute ();
8078 while (!job .getStatus ().getState ().equals ("DONE" )) {
8179 System .out .println ("Job is "
82- + job .getStatus ().getState ()
83- + " waiting " + interval + " milliseconds..." );
80+ + job .getStatus ().getState ()
81+ + " waiting " + interval + " milliseconds..." );
8482 Thread .sleep (interval );
8583 job = request .execute ();
8684 }
@@ -97,7 +95,7 @@ public static Job pollJob(final Bigquery.Jobs.Get request, final long
9795 */
9896 // [START paging]
9997 public static <T extends GenericJson > Iterator <T > getPages (
100- final BigqueryRequest <T > requestTemplate ) {
98+ final BigqueryRequest <T > requestTemplate ) {
10199
102100 /**
103101 * An iterator class that pages through a Bigquery request.
@@ -168,8 +166,8 @@ public static TableSchema loadSchema(final Reader schemaSource) {
168166 TableSchema sourceSchema = new TableSchema ();
169167
170168 List <TableFieldSchema > fields = (new Gson ())
171- .<List <TableFieldSchema >>fromJson (schemaSource ,
172- (new ArrayList <TableFieldSchema >()).getClass ());
169+ .<List <TableFieldSchema >>fromJson (schemaSource ,
170+ (new ArrayList <TableFieldSchema >()).getClass ());
173171
174172 sourceSchema .setFields (fields );
175173
@@ -186,8 +184,7 @@ public static TableSchema loadSchema(final Reader schemaSource) {
186184 * @throws IOException Thrown if there is a network error connecting to
187185 * Bigquery.
188186 */
189- public static void listDatasets (final Bigquery bigquery , final String
190- projectId )
187+ public static void listDatasets (final Bigquery bigquery , final String projectId )
191188 throws IOException {
192189 Datasets .List datasetRequest = bigquery .datasets ().list (projectId );
193190 DatasetList datasetList = datasetRequest .execute ();
@@ -201,5 +198,4 @@ public static void listDatasets(final Bigquery bigquery, final String
201198 }
202199 }
203200 // [END list_datasets]
204-
205201}
0 commit comments