40
40
/** A Google BigQuery Job statistics. */
41
41
public abstract class JobStatistics implements Serializable {
42
42
43
- private static final long serialVersionUID = 1433024714741660399L ;
43
+ private static final long serialVersionUID = 1433024714741660400L ;
44
44
45
45
private final Long creationTime ;
46
46
private final Long endTime ;
@@ -51,6 +51,7 @@ public abstract class JobStatistics implements Serializable {
51
51
private final List <ReservationUsage > reservationUsage ;
52
52
private final TransactionInfo transactionInfo ;
53
53
private final SessionInfo sessionInfo ;
54
+ private final Long totalSlotMs ;
54
55
55
56
/** A Google BigQuery Copy Job statistics. */
56
57
public static class CopyStatistics extends JobStatistics {
@@ -390,7 +391,7 @@ static LoadStatistics fromPb(com.google.api.services.bigquery.model.JobStatistic
390
391
/** A Google BigQuery Query Job statistics. */
391
392
public static class QueryStatistics extends JobStatistics {
392
393
393
- private static final long serialVersionUID = 7539354109226732353L ;
394
+ private static final long serialVersionUID = 7539354109226732354L ;
394
395
395
396
private final BiEngineStats biEngineStats ;
396
397
private final Integer billingTier ;
@@ -407,7 +408,6 @@ public static class QueryStatistics extends JobStatistics {
407
408
private final Long totalBytesBilled ;
408
409
private final Long totalBytesProcessed ;
409
410
private final Long totalPartitionsProcessed ;
410
- private final Long totalSlotMs ;
411
411
private final List <QueryStage > queryPlan ;
412
412
private final List <TimelineSample > timeline ;
413
413
private final Schema schema ;
@@ -567,7 +567,6 @@ static final class Builder extends JobStatistics.Builder<QueryStatistics, Builde
567
567
private Long totalBytesBilled ;
568
568
private Long totalBytesProcessed ;
569
569
private Long totalPartitionsProcessed ;
570
- private Long totalSlotMs ;
571
570
private List <QueryStage > queryPlan ;
572
571
private List <TimelineSample > timeline ;
573
572
private Schema schema ;
@@ -599,7 +598,6 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP
599
598
this .totalBytesBilled = statisticsPb .getQuery ().getTotalBytesBilled ();
600
599
this .totalBytesProcessed = statisticsPb .getQuery ().getTotalBytesProcessed ();
601
600
this .totalPartitionsProcessed = statisticsPb .getQuery ().getTotalPartitionsProcessed ();
602
- this .totalSlotMs = statisticsPb .getQuery ().getTotalSlotMs ();
603
601
if (statisticsPb .getQuery ().getStatementType () != null ) {
604
602
this .statementType = StatementType .valueOf (statisticsPb .getQuery ().getStatementType ());
605
603
}
@@ -719,11 +717,6 @@ Builder setTotalPartitionsProcessed(Long totalPartitionsProcessed) {
719
717
return self ();
720
718
}
721
719
722
- Builder setTotalSlotMs (Long totalSlotMs ) {
723
- this .totalSlotMs = totalSlotMs ;
724
- return self ();
725
- }
726
-
727
720
Builder setQueryPlan (List <QueryStage > queryPlan ) {
728
721
this .queryPlan = queryPlan ;
729
722
return self ();
@@ -777,7 +770,6 @@ private QueryStatistics(Builder builder) {
777
770
this .totalBytesBilled = builder .totalBytesBilled ;
778
771
this .totalBytesProcessed = builder .totalBytesProcessed ;
779
772
this .totalPartitionsProcessed = builder .totalPartitionsProcessed ;
780
- this .totalSlotMs = builder .totalSlotMs ;
781
773
this .queryPlan = builder .queryPlan ;
782
774
this .timeline = builder .timeline ;
783
775
this .schema = builder .schema ;
@@ -874,11 +866,6 @@ public Long getTotalPartitionsProcessed() {
874
866
return totalPartitionsProcessed ;
875
867
}
876
868
877
- /** Returns the slot-milliseconds consumed by the query. */
878
- public Long getTotalSlotMs () {
879
- return totalSlotMs ;
880
- }
881
-
882
869
/**
883
870
* Returns the query plan as a list of stages or {@code null} if a query plan is not available.
884
871
* Each stage involves a number of steps that read from data sources, perform a series of
@@ -984,7 +971,6 @@ com.google.api.services.bigquery.model.JobStatistics toPb() {
984
971
queryStatisticsPb .setTotalBytesBilled (totalBytesBilled );
985
972
queryStatisticsPb .setTotalBytesProcessed (totalBytesProcessed );
986
973
queryStatisticsPb .setTotalPartitionsProcessed (totalPartitionsProcessed );
987
- queryStatisticsPb .setTotalSlotMs (totalSlotMs );
988
974
if (ddlTargetTable != null ) {
989
975
queryStatisticsPb .setDdlTargetTable (ddlTargetTable .toPb ());
990
976
}
@@ -1589,6 +1575,7 @@ abstract static class Builder<T extends JobStatistics, B extends Builder<T, B>>
1589
1575
private List <ReservationUsage > reservationUsage ;
1590
1576
private TransactionInfo transactionInfo ;
1591
1577
private SessionInfo sessionInfo ;
1578
+ private Long totalSlotMs ;
1592
1579
1593
1580
protected Builder () {}
1594
1581
@@ -1598,6 +1585,9 @@ protected Builder(com.google.api.services.bigquery.model.JobStatistics statistic
1598
1585
this .startTime = statisticsPb .getStartTime ();
1599
1586
this .numChildJobs = statisticsPb .getNumChildJobs ();
1600
1587
this .parentJobId = statisticsPb .getParentJobId ();
1588
+ if (statisticsPb .getTotalSlotMs () != null ) {
1589
+ this .totalSlotMs = statisticsPb .getTotalSlotMs ();
1590
+ }
1601
1591
if (statisticsPb .getScriptStatistics () != null ) {
1602
1592
this .scriptStatistics = ScriptStatistics .fromPb (statisticsPb .getScriptStatistics ());
1603
1593
}
@@ -1633,6 +1623,11 @@ B setStartTime(Long startTime) {
1633
1623
return self ();
1634
1624
}
1635
1625
1626
+ B setTotalSlotMs (Long totalSlotMs ) {
1627
+ this .totalSlotMs = totalSlotMs ;
1628
+ return self ();
1629
+ }
1630
+
1636
1631
abstract T build ();
1637
1632
}
1638
1633
@@ -1646,6 +1641,7 @@ protected JobStatistics(Builder builder) {
1646
1641
this .reservationUsage = builder .reservationUsage ;
1647
1642
this .transactionInfo = builder .transactionInfo ;
1648
1643
this .sessionInfo = builder .sessionInfo ;
1644
+ this .totalSlotMs = builder .totalSlotMs ;
1649
1645
}
1650
1646
1651
1647
/** Returns the creation time of the job in milliseconds since epoch. */
@@ -1699,6 +1695,11 @@ public SessionInfo getSessionInfo() {
1699
1695
return sessionInfo ;
1700
1696
}
1701
1697
1698
+ /** Returns the slot-milliseconds for the job. */
1699
+ public Long getTotalSlotMs () {
1700
+ return totalSlotMs ;
1701
+ }
1702
+
1702
1703
ToStringHelper toStringHelper () {
1703
1704
return MoreObjects .toStringHelper (this )
1704
1705
.add ("creationTime" , creationTime )
@@ -1709,7 +1710,8 @@ ToStringHelper toStringHelper() {
1709
1710
.add ("scriptStatistics" , scriptStatistics )
1710
1711
.add ("reservationUsage" , reservationUsage )
1711
1712
.add ("transactionInfo" , transactionInfo )
1712
- .add ("sessionInfo" , sessionInfo );
1713
+ .add ("sessionInfo" , sessionInfo )
1714
+ .add ("totalSlotMs" , totalSlotMs );
1713
1715
}
1714
1716
1715
1717
@ Override
@@ -1727,7 +1729,8 @@ final int baseHashCode() {
1727
1729
scriptStatistics ,
1728
1730
reservationUsage ,
1729
1731
transactionInfo ,
1730
- sessionInfo );
1732
+ sessionInfo ,
1733
+ totalSlotMs );
1731
1734
}
1732
1735
1733
1736
final boolean baseEquals (JobStatistics jobStatistics ) {
@@ -1742,6 +1745,7 @@ com.google.api.services.bigquery.model.JobStatistics toPb() {
1742
1745
statistics .setStartTime (startTime );
1743
1746
statistics .setNumChildJobs (numChildJobs );
1744
1747
statistics .setParentJobId (parentJobId );
1748
+ statistics .setTotalSlotMs (totalSlotMs );
1745
1749
if (scriptStatistics != null ) {
1746
1750
statistics .setScriptStatistics (scriptStatistics .toPb ());
1747
1751
}
0 commit comments