@@ -35,6 +35,7 @@ import org.apache.spark.sql.delta.sources.DeltaSQLConf
35
35
import org .apache .spark .sql .delta .util .FileNames ._
36
36
import org .apache .spark .sql .delta .util .JsonUtils
37
37
import org .apache .spark .sql .delta .util .threads .DeltaThreadPool
38
+ import org .apache .spark .sql .delta .util .{Utils => DeltaUtils }
38
39
import com .fasterxml .jackson .annotation .JsonIgnore
39
40
import io .delta .storage .commit .{Commit , GetCommitsResponse }
40
41
import org .apache .hadoop .fs .{BlockLocation , FileStatus , LocatedFileStatus , Path }
@@ -44,7 +45,7 @@ import org.apache.spark.internal.MDC
44
45
import org .apache .spark .sql .SparkSession
45
46
import org .apache .spark .sql .catalyst .TableIdentifier
46
47
import org .apache .spark .sql .catalyst .catalog .CatalogTable
47
- import org .apache .spark .util .{ ThreadUtils , Utils }
48
+ import org .apache .spark .util .ThreadUtils
48
49
49
50
/**
50
51
* Wraps the most recently updated snapshot along with the timestamp the update was started.
@@ -270,7 +271,7 @@ trait SnapshotManagement { self: DeltaLog =>
270
271
deltaLog = this ,
271
272
opType = CoordinatedCommitsUsageLogs .FS_COMMIT_COORDINATOR_LISTING_UNEXPECTED_GAPS ,
272
273
data = eventData)
273
- if (Utils .isTesting) {
274
+ if (DeltaUtils .isTesting) {
274
275
throw new IllegalStateException (
275
276
s " Delta table at $dataPath unexpectedly still requires additional file-system listing " +
276
277
s " after an additional file-system listing was already performed to reconcile the gap " +
@@ -646,7 +647,7 @@ trait SnapshotManagement { self: DeltaLog =>
646
647
deltaLog = this ,
647
648
opType = " delta.getLogSegmentForVersion.compactedDeltaValidationFailed" ,
648
649
data = eventData)
649
- if (Utils .isTesting) {
650
+ if (DeltaUtils .isTesting) {
650
651
assert(false , s " Validation around Compacted deltas failed while creating Snapshot. " +
651
652
s " [ ${JsonUtils .toJson(eventData)}] " )
652
653
}
@@ -1071,7 +1072,7 @@ trait SnapshotManagement { self: DeltaLog =>
1071
1072
catalogTableOpt)
1072
1073
}
1073
1074
} catch {
1074
- case NonFatal (e) if ! Utils .isTesting =>
1075
+ case NonFatal (e) if ! DeltaUtils .isTesting =>
1075
1076
// Failed to schedule the future -- fail in testing, but just log it in prod.
1076
1077
recordDeltaEvent(this , " delta.snapshot.asyncUpdateFailed" , data = Map (" exception" -> e))
1077
1078
}
@@ -1200,7 +1201,7 @@ trait SnapshotManagement { self: DeltaLog =>
1200
1201
/** Installs the given `newSnapshot` as the `currentSnapshot` */
1201
1202
protected def installSnapshot (newSnapshot : Snapshot , updateTimestamp : Long ): Snapshot = {
1202
1203
if (! snapshotLock.isHeldByCurrentThread) {
1203
- if (Utils .isTesting) {
1204
+ if (DeltaUtils .isTesting) {
1204
1205
throw new RuntimeException (" DeltaLog snapshot replaced without taking lock" )
1205
1206
}
1206
1207
recordDeltaEvent(this , " delta.update.unsafeReplace" )
@@ -1292,7 +1293,7 @@ trait SnapshotManagement { self: DeltaLog =>
1292
1293
// NOTE: Validation is a no-op with incremental commit disabled.
1293
1294
newSnapshot.validateChecksum(Map (" context" -> checksumContext))
1294
1295
} catch {
1295
- case _ : IllegalStateException if ! Utils .isTesting => false
1296
+ case _ : IllegalStateException if ! DeltaUtils .isTesting => false
1296
1297
}
1297
1298
1298
1299
if (! crcIsValid) {
0 commit comments