Skip to content

Commit d965715

Browse files
bobbai00MA77HEW820
authored andcommitted
Remove the corresponding resource entry from the global ExecutionResourceMapping during the garbage collection (#3216)
This PR completes the garbage collection logic under the newly-introduced URIs and ExecutionResourceMapping. During the garbage collection, after all the documents associated with the last execution id are released, it then removes the entry from the mapping. This PR also did the scalafixAll to remove unused imports.
1 parent 823d4a5 commit d965715

File tree

16 files changed

+19
-31
lines changed

16 files changed

+19
-31
lines changed

core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/ScheduleGenerator.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package edu.uci.ics.amber.engine.architecture.scheduling
22

33
import edu.uci.ics.amber.core.storage.{DocumentFactory, VFSURIFactory}
4-
import edu.uci.ics.amber.core.storage.VFSResourceType.MATERIALIZED_RESULT
54
import edu.uci.ics.amber.core.storage.result.ExecutionResourcesMapping
65
import edu.uci.ics.amber.core.workflow.{PhysicalOp, PhysicalPlan, WorkflowContext}
76
import edu.uci.ics.amber.engine.architecture.scheduling.ScheduleGenerator.replaceVertex

core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetAccessResource.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ import edu.uci.ics.texera.dao.SqlServer
66
import edu.uci.ics.texera.web.model.common.AccessEntry
77
import edu.uci.ics.texera.dao.jooq.generated.Tables.USER
88
import edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege
9-
import edu.uci.ics.texera.dao.jooq.generated.tables.Dataset.DATASET
109
import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserAccess.DATASET_USER_ACCESS
1110
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{DatasetDao, DatasetUserAccessDao, UserDao}
1211
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{DatasetUserAccess, User}
1312
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetAccessResource.{
1413
context,
1514
getOwner
1615
}
17-
import org.jooq.{Condition, DSLContext}
18-
import org.jooq.impl.DSL
16+
import org.jooq.DSLContext
1917
import org.jooq.types.UInteger
2018

2119
import java.util

core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetResource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{
2525
DatasetVersion,
2626
User
2727
}
28-
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetAccessResource.{context, _}
28+
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetAccessResource._
2929
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource.{context, _}
3030
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.`type`.DatasetFileNode
3131
import io.dropwizard.auth.Auth

core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import edu.uci.ics.amber.core.storage.StorageConfig
44
import edu.uci.ics.amber.engine.architecture.logreplay.{ReplayDestination, ReplayLogRecord}
55
import edu.uci.ics.amber.engine.common.storage.SequentialRecordStorage
66
import edu.uci.ics.amber.core.virtualidentity.{ChannelMarkerIdentity, ExecutionIdentity}
7-
import edu.uci.ics.amber.engine.common.AmberConfig
87
import edu.uci.ics.texera.dao.SqlServer
98
import edu.uci.ics.texera.web.auth.SessionUser
109
import edu.uci.ics.texera.dao.jooq.generated.Tables.{

core/amber/src/main/scala/edu/uci/ics/texera/web/service/ExecutionResultService.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.{JsonTypeInfo, JsonTypeName}
55
import com.fasterxml.jackson.databind.node.ObjectNode
66
import com.typesafe.scalalogging.LazyLogging
77
import edu.uci.ics.amber.core.storage.DocumentFactory.MONGODB
8-
import edu.uci.ics.amber.core.storage.VFSResourceType.{MATERIALIZED_RESULT, RESULT}
8+
import edu.uci.ics.amber.core.storage.VFSResourceType.MATERIALIZED_RESULT
99
import edu.uci.ics.amber.core.storage.model.VirtualDocument
1010
import edu.uci.ics.amber.core.storage.{DocumentFactory, StorageConfig, VFSURIFactory}
1111
import edu.uci.ics.amber.core.storage.result._
@@ -35,10 +35,8 @@ import edu.uci.ics.texera.web.model.websocket.event.{
3535
WebResultUpdateEvent
3636
}
3737
import edu.uci.ics.texera.web.model.websocket.request.ResultPaginationRequest
38-
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowExecutionsResource
3938
import edu.uci.ics.texera.web.service.WorkflowExecutionService.getLatestExecutionId
4039
import edu.uci.ics.texera.web.storage.{ExecutionStateStore, WorkflowStateStore}
41-
import org.jooq.types.UInteger
4240

4341
import java.util.UUID
4442
import scala.collection.mutable

core/amber/src/main/scala/edu/uci/ics/texera/web/service/ResultExportService.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.google.api.services.drive.model.{File, FileList, Permission}
88
import com.google.api.services.sheets.v4.Sheets
99
import com.google.api.services.sheets.v4.model.{Spreadsheet, SpreadsheetProperties, ValueRange}
1010
import edu.uci.ics.amber.core.storage.{DocumentFactory, VFSURIFactory}
11-
import edu.uci.ics.amber.core.storage.VFSResourceType.RESULT
1211
import edu.uci.ics.amber.core.storage.model.VirtualDocument
1312
import edu.uci.ics.amber.core.tuple.Tuple
1413
import edu.uci.ics.amber.engine.common.Utils.retry

core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowService.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,18 @@ import edu.uci.ics.amber.core.virtualidentity.{
2222
ExecutionIdentity,
2323
WorkflowIdentity
2424
}
25-
import edu.uci.ics.amber.core.workflow.WorkflowContext.DEFAULT_EXECUTION_ID
2625
import edu.uci.ics.amber.core.workflowruntimestate.FatalErrorType.EXECUTION_FAILURE
2726
import edu.uci.ics.amber.core.workflowruntimestate.WorkflowFatalError
2827
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
2928
import edu.uci.ics.texera.web.model.websocket.event.TexeraWebSocketEvent
3029
import edu.uci.ics.texera.web.model.websocket.request.WorkflowExecuteRequest
31-
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowExecutionsResource
3230
import edu.uci.ics.texera.web.service.WorkflowService.mkWorkflowStateId
3331
import edu.uci.ics.texera.web.storage.ExecutionStateStore.updateWorkflowState
3432
import edu.uci.ics.texera.web.storage.{ExecutionStateStore, WorkflowStateStore}
3533
import edu.uci.ics.texera.web.{SubscriptionManager, WorkflowLifecycleManager}
3634
import edu.uci.ics.texera.workflow.LogicalPlan
3735
import io.reactivex.rxjava3.disposables.{CompositeDisposable, Disposable}
3836
import io.reactivex.rxjava3.subjects.BehaviorSubject
39-
import org.jooq.types.UInteger
4037
import play.api.libs.json.Json
4138

4239
import java.net.URI
@@ -101,6 +98,7 @@ class WorkflowService(
10198
case _: Throwable => // exception can be raised if the document is already cleared
10299
}
103100
)
101+
ExecutionResourcesMapping.removeExecutionResources(eid)
104102
})
105103
WorkflowService.workflowServiceMapping.remove(mkWorkflowStateId(workflowId))
106104
if (executionService.getValue != null) {
@@ -185,6 +183,7 @@ class WorkflowService(
185183
case _: Throwable =>
186184
}
187185
)
186+
ExecutionResourcesMapping.removeExecutionResources(eid)
188187
}) // TODO: change this behavior after enabling cache.
189188

190189
workflowContext.executionId = ExecutionsMetadataPersistService.insertNewExecution(

core/amber/src/main/scala/edu/uci/ics/texera/workflow/WorkflowCompiler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package edu.uci.ics.texera.workflow
22

33
import com.typesafe.scalalogging.LazyLogging
4-
import edu.uci.ics.amber.core.storage.VFSResourceType.RESULT
54
import edu.uci.ics.amber.core.storage.{DocumentFactory, StorageConfig, VFSURIFactory}
65
import edu.uci.ics.amber.core.storage.result.ExecutionResourcesMapping
76
import edu.uci.ics.amber.core.workflow.{PhysicalPlan, WorkflowContext}

core/amber/src/test/scala/edu/uci/ics/amber/engine/e2e/DataProcessingSpec.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import ch.vorburger.mariadb4j.DB
88
import com.twitter.util.{Await, Duration, Promise}
99
import edu.uci.ics.amber.clustering.SingleNodeListener
1010
import edu.uci.ics.amber.core.storage.{DocumentFactory, VFSURIFactory}
11-
import edu.uci.ics.amber.core.storage.VFSResourceType.RESULT
1211
import edu.uci.ics.amber.core.storage.model.VirtualDocument
1312
import edu.uci.ics.amber.core.storage.result.ExecutionResourcesMapping
1413
import edu.uci.ics.amber.core.tuple.{AttributeType, Tuple}

core/amber/src/test/scala/edu/uci/ics/texera/workflow/common/storage/ReadonlyLocalFileDocumentSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package edu.uci.ics.amber.engine.common.storage
22

33
import edu.uci.ics.amber.core.storage.DocumentFactory
4-
import edu.uci.ics.amber.core.storage.model.{ReadonlyLocalFileDocument, ReadonlyVirtualDocument}
4+
import edu.uci.ics.amber.core.storage.model.ReadonlyVirtualDocument
55
import org.scalatest.BeforeAndAfter
66
import org.scalatest.flatspec.AnyFlatSpec
77
import org.scalatest.matchers.should.Matchers

0 commit comments

Comments
 (0)