Packages

final class PKEParallelTasksPropertyStore extends PropertyStore

A concurrent implementation of the property store which parallels the execution of the scheduled computations.

Entities are stored after computation.

Implementation

The idea is to use one specific thread (the store updates thread) for processing updates to the store. This enables us to avoid any synchronization w.r.t. updating the depender/dependee relations.

We use NumberOfThreadsForProcessingPropertyComputations threads for processing the scheduled computations.

Self Type
PKEParallelTasksPropertyStore
Linear Supertypes
PropertyStore, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PKEParallelTasksPropertyStore
  2. PropertyStore
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val NumberOfThreadsForProcessingPropertyComputations: Int
  5. final def apply[E <: Entity, P <: Property](epk: EPK[E, P]): EOptionP[E, P]

    Returns the property of the respective property kind pk currently associated with the given element e.

    Returns the property of the respective property kind pk currently associated with the given element e.

    This is the most basic method to get some property and it is the preferred way if (a) you know that the property is already available – e.g., because some property computation function was strictly run before the current one – or if (b) the property is computed using a lazy property computation - or if (c) it may be possible to compute a final answer even if the property of the entity is not yet available.

    epk

    An entity/property key pair.

    returns

    EPK(e,pk) if information about the respective property is not (yet) available. Final|IntermediateEP(e,Property) otherwise.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Exceptions thrown

    IllegalStateException If setup phase was not called or a previous computation result contained an epk which was not queried. (Both state are ALWAYS illegal, but are only explicitly checked for if debug is turned on!)

    Note

    In general, the returned value may change over time but only such that it is strictly more precise.

    ,

    Querying a property may trigger the (lazy) computation of the property.

    ,

    setupPhase has to be called before calling apply!

  6. def apply[E <: Entity, P <: Property](e: E, pk: PropertyKey[P]): EOptionP[E, P]

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    See also

    apply(epk:EPK) for details.

  7. final def apply[E <: Entity, P <: Property](es: Traversable[E], pmi: PropertyMetaInformation { type Self <: P }): Traversable[EOptionP[E, P]]

    Returns a snapshot of the properties with the given kind associated with the given entities.

    Returns a snapshot of the properties with the given kind associated with the given entities.

    Definition Classes
    PropertyStore
    Note

    Querying the properties of the given entities will trigger lazy computations.

    ,

    The returned collection can be used to create an IntermediateResult.

    See also

    apply(epk:EPK) for details.

  8. final def apply[E <: Entity, P <: Property](es: Traversable[E], pk: PropertyKey[P]): Traversable[EOptionP[E, P]]

    Returns a snapshot of the properties with the given kind associated with the given entities.

    Returns a snapshot of the properties with the given kind associated with the given entities.

    Definition Classes
    PropertyStore
    Note

    Querying the properties of the given entities will trigger lazy computations.

    ,

    The returned collection can be used to create an IntermediateResult.

    See also

    apply(epk:EPK) for details.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def collectAndThrowException(t: Throwable): Nothing
    Attributes
    protected[this]
    Definition Classes
    PropertyStore
    Annotations
    @inline()
  12. def collectException(t: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    PropertyStore
  13. final def context[T](key: Class[T]): T

    Looks up the context object of the given type.

    Looks up the context object of the given type. This is a comparatively expensive operation; the result should be cached.

    Definition Classes
    PropertyStore
  14. val ctx: Map[Class[_], AnyRef]

    Immutable map which stores the context objects given at initialization time.

    Immutable map which stores the context objects given at initialization time.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  15. final def debug: Boolean

    If "debug" is true and we have an update related to an ordered property, we will then check if the update is correct!

    If "debug" is true and we have an update related to an ordered property, we will then check if the update is correct!

    Definition Classes
    PropertyStore
  16. def directDependeeUpdatesCount: Int
  17. def directDependerOnUpdateComputationsCount: Int

    Computations which are executed immediately and which are not scheduled.

  18. def directInTaskThreadPropertyComputationsCount: Int
  19. def entities[P <: Property](pk: PropertyKey[P]): Iterator[EPS[Entity, P]]

    Returns all entities which have a property of the respective kind.

    Returns all entities which have a property of the respective kind. This method returns a consistent snapshot view of the store w.r.t. the given PropertyKey.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    Does not trigger lazy property computations.

  20. def entities[P <: Property](lb: P, ub: P): Iterator[Entity]

    Returns all entities which have the given (regular / not simple) property bounds based on an "==" (equals) comparison.

    Returns all entities which have the given (regular / not simple) property bounds based on an "==" (equals) comparison.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  21. def entities(propertyFilter: (SomeEPS) ⇒ Boolean): Iterator[Entity]

    The set of all entities which already have an entity property state that passes the given filter.

    The set of all entities which already have an entity property state that passes the given filter.

    This method returns a snapshot.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    Does not trigger lazy property computations.

  22. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  24. var exception: Throwable
    Attributes
    protected[this]
    Definition Classes
    PropertyStore
  25. def fallbacksUsedCount: Int
  26. def fastTrackPropertiesCount: Int

    The number of properties that were computed using a fast-track.

    The number of properties that were computed using a fast-track.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  27. def finalEntities[P <: Property](p: P): Iterator[Entity]

    Returns all final entities with the given property.

    Returns all final entities with the given property.

    Definition Classes
    PropertyStore
    Note

    Does not trigger lazy property computations.

  28. def finalize(): Unit
    Definition Classes
    PKEParallelTasksPropertyStore → AnyRef
  29. def force[E <: Entity, P <: Property](e: E, pk: PropertyKey[P]): Unit

    Enforce the evaluation of the specified property kind for the given entity, even if the property is computed lazily and no "eager computation" requires the results anymore.

    Enforce the evaluation of the specified property kind for the given entity, even if the property is computed lazily and no "eager computation" requires the results anymore. Force also ensures that the property is stored in the store even if the fallback value is used. Using force is in particular necessary in cases where a specific analysis should be scheduled lazily because the computed information is not necessary for all entities, but strictly required for some elements. E.g., if you want to compute a property for some piece of code, but not for those elements of the used library that are strictly necessary. For example, if we want to compute the purity of the methods of a specific application, we may have to compute the property for some entities of the libraries, but we don't want to compute them for all.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    Triggers lazy evaluations.

  30. def gatherExceptions(f: ⇒ Unit): Unit
    Attributes
    protected[this]
    Annotations
    @inline()
  31. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. def handleExceptions[U](f: ⇒ U): U
    Attributes
    protected[this]
    Definition Classes
    PropertyStore
    Annotations
    @inline()
  33. final def handleResult(r: PropertyComputationResult, forceEvaluation: Boolean): Unit

    Processes the result eventually; generally, not directly called by analyses.

    Processes the result eventually; generally, not directly called by analyses. If this function is directly called, the caller has to ensure that we don't have overlapping results and that the given result is a meaningful update of the previous property associated with the respective entity - if any!

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Exceptions thrown

    IllegalStateException If the result cannot be applied.

    Note

    If any computation resulted in an exception, then handleResult will fail and the exception related to the failing computation will be thrown again.

  34. def hasProperty(e: Entity, pk: PropertyKind): Boolean

    See hasProperty(SomeEPK) for details.

    See hasProperty(SomeEPK) for details. *

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  35. final def hasProperty(epk: SomeEPK): Boolean

    Tests if we have a property for the entity with the respective kind.

    Tests if we have a property for the entity with the respective kind. If hasProperty returns true a subsequent apply will return an EPS (not an EPK).

    Definition Classes
    PropertyStore
  36. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  37. def immediateOnUpdateComputationsCount: Int

    The number of times a property was directly computed again due to an updated dependee.

    The number of times a property was directly computed again due to an updated dependee.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. def isKnown(e: Entity): Boolean

    Returns true if the given entity is known to the property store.

    Returns true if the given entity is known to the property store. Here, isKnown can mean

    • that we actually have a property, or
    • a computation is scheduled/running to compute some property, or
    • an analysis has a dependency on some (not yet finally computed) property, or
    • that the store just eagerly created the data structures necessary to associate properties with the entity.
    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  40. var isSuspended: () ⇒ Boolean

    The callback function that is regularly called by the property store to test if the property store should stop executing new tasks.

    The callback function that is regularly called by the property store to test if the property store should stop executing new tasks. Given that the given method is called frequently, it should be reasonably efficient. The method has to be thread-safe.

    The default method tests if the current thread is interrupted.

    Suspending the property store will leave the property store in a consistent state and the computation can be continued later on by updating this function (if necessary) and calling waitOnPhaseCompletion again. I.e., interruption can be used for debugging purposes!

    Definition Classes
    PropertyStore
  41. implicit val logContext: LogContext
  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  45. def onFirstException(t: Throwable): Unit

    Called when the first top-level exception occurs.

    Called when the first top-level exception occurs. Intended to be overridden by subclasses.

    Attributes
    protected[this]
    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  46. def properties[E <: Entity](e: E): Iterator[EPS[E, Property]]

    Returns an iterator of the different properties associated with the given element.

    Returns an iterator of the different properties associated with the given element.

    This method is the preferred way to get a snapshot of all properties of an entity and should be used if you know that all properties are already computed. Using this method will not trigger the computation of a property.

    e

    An entity stored in the property store.

    returns

    Iterator[Property]

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    The returned traversable operates on a snapshot.

    ,

    Does not trigger lazy property computations.

  47. def quiescenceCount: Int

    The number of times the property store reached quiescence.

    The number of times the property store reached quiescence.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  48. def redundantIdempotentResultsCount: Int
  49. def registerLazyMultiPropertyComputation[E <: Entity, P <: Property](pc: PropertyComputation[E], pks: PropertyKey[P]*): Unit

    Registers a function that lazily computes multiple properties of different kinds at the same time for an element of the store.

    Registers a function that lazily computes multiple properties of different kinds at the same time for an element of the store.

    For further details see registerLazyPropertyComputation.

    Definition Classes
    PropertyStore
  50. def registerLazyPropertyComputation[E <: Entity, P <: Property](pk: PropertyKey[P], pc: PropertyComputation[E]): Unit

    Registers a function that lazily computes a property for an element of the store if the property of the respective kind is requested.

    Registers a function that lazily computes a property for an element of the store if the property of the respective kind is requested. Hence, a first request of such a property will always first return no result.

    The computation is triggered by a(n in)direct call of this store's apply method.

    This store ensures that the property computation function pc is never invoked more than once for the same element at the same time. If pc is invoked again for a specific element then only because a dependee has changed!

    In general, the result can't be an IncrementalResult and scheduleLazyPropertyComputation cannot be used for properties which should be computed by phased analyses.

    A lazy computation must never return a NoResult; if the entity cannot be processed an exception has to be thrown or the bottom value has to be returned.

    Setting scheduleLazyPropertyComputation is only supported as long as the store is not queried. In general, this requires that lazy property computations are scheduled before any eager analysis that potentially reads the value.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  51. def registerTriggeredComputation[E <: Entity, P <: Property](pk: PropertyKey[P], pc: PropertyComputation[E]): Unit

    Registers a property computation that is eagerly triggered when a property of the given kind is derived for some entity for the first time.

    Registers a property computation that is eagerly triggered when a property of the given kind is derived for some entity for the first time. Note, that the property computation function – as usual – has to be thread safe (only on-update continuation functions are guaranteed to be executed sequentially per E/PK pair). The primary use case is to kick-start the computation of some e/pk as soon as an entity "becomes relevant".

    In general, it also possible to have a standard analysis that just queries the properties of the respective entities and which maintains the list of dependees. However, if the list of dependees becomes larger and (at least initially) encompasses a significant fraction or even all entities of a specific kind, the overhead that is generated in the framework becomes very huge. In this case, it is way more efficient to register a triggered computation.

    For example, if you want to do some processing (kick-start further computations) related to methods that are reached, it is more efficient to register a property computation that is triggered when a method's Caller property is set. Please note, that the property computation is allowed to query and depend on the property that initially kicked-off the computation in the first place. Querying the property store may in particular be required to identify the reason why the property was set. For example, if the Caller property was set to the fallback due to a depending computation, it may be necessary to distinguish between the case "no callers" and "unknown callers"; in case of the final property "no callers" the result may very well be NoResult.

    pk

    The property key.

    pc

    The computation that is (potentially concurrently) called to kick-start a computation related to the given entity.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  52. def resolvedCSCCsCount: Int

    The number of resolved closed strongly connected components.

    The number of resolved closed strongly connected components.

    Please note, that depending on the implementation strategy and the type of the closed strongly connected component, the resolution of one strongly connected component may require multiple phases. This is in particular true if a cSCC is resolved by committing an arbitrary value as a final value and we have a cSCC which is actually a chain-like cSCC. In the latter case committing a single value as final which just break up the chain, but will otherwise (in case of chains with more than three elements) lead to new cSCCs which the require detection and resolution.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  53. def scheduleEagerComputationForEntity[E <: Entity](e: E)(pc: PropertyComputation[E]): Unit

    Schedules the execution of the given PropertyComputation function for the given entity.

    Schedules the execution of the given PropertyComputation function for the given entity. This is of particular interest to start an incremental computation (cf. IncrementalResult) which, e.g., processes the class hierarchy in a top-down manner.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    It is NOT possible to use scheduleEagerComputationForEntity for properties which are also computed by a lazy property computation; use force instead!

    ,

    If any computation resulted in an exception, then the scheduling will fail and the exception related to the failing computation will be thrown again.

  54. def scheduleEagerComputationsForEntities[E <: Entity](es: TraversableOnce[E])(c: PropertyComputation[E]): Unit

    Will call the given function c for all elements of es in parallel.

    Will call the given function c for all elements of es in parallel.

    Definition Classes
    PropertyStore
    See also

    scheduleEagerComputationForEntity for details.

  55. def scheduledDependeeUpdatesCount: Int

    Computations of dependees which are scheduled immediately.

  56. def scheduledLazyTasksCount: Int
  57. def scheduledOnUpdateComputationsCount: Int

    Simple counter of the number of tasks (OnUpdateContinuations) that were executed in response to an updated property.

    Simple counter of the number of tasks (OnUpdateContinuations) that were executed in response to an updated property.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  58. def scheduledTasksCount: Int

    Simple counter of the number of tasks that were executed to perform an initial computation of a property for some entity.

    Simple counter of the number of tasks that were executed to perform an initial computation of a property for some entity.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  59. def set(e: Entity, p: Property): Unit

    Directly associates the given property p with property kind pk with the given entity e if e has no property of the respective kind.

    Directly associates the given property p with property kind pk with the given entity e if e has no property of the respective kind. The set property is always final. The store does not guarantee that the value is set before before a later scheduled analysis is executed. I.e., no guarantee is given that the value is set immediately.

    A use case is an analysis that does use the property store while executing the analysis, but which wants to store the results in the store. Such an analysis must be executed before any other analysis is scheduled.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Exceptions thrown

    IllegalStateException If a different property is already associated with the given entity or a lazy computation is registered. I.e., set has to be called before respective lazy property computations are registered. The exception may be thrown eventually!

    Note

    This method must not be used if there might be another computation that computes the property kind pk for e and which returns the respective property as a result.

  60. def setupPhase(computedPropertyKinds: Set[PropertyKind], delayedPropertyKinds: Set[PropertyKind]): Unit

    Needs to be called before an analysis is scheduled to inform the property store which properties will be computed now and which are computed in a later phase.

    Needs to be called before an analysis is scheduled to inform the property store which properties will be computed now and which are computed in a later phase. The later information is used to decide when we use a fallback.

    computedPropertyKinds

    The kinds of properties for which we will schedule computations.

    delayedPropertyKinds

    The set of property kinds which will (also) be computed in a later phase; no fallback will be used for dependencies to properties of the respective kind.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    setupPhase even needs to be called if just fallback values should be computed; in this case both sets have to be empty.

  61. def shutdown(): Unit
  62. def statistics: Map[String, Int]

    Core statistics.

    Core statistics.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
  63. final def supportsFastTrackPropertyComputations: Boolean
  64. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  65. def toString(printProperties: Boolean): String

    Returns a consistent snapshot of the stored properties.

    Returns a consistent snapshot of the stored properties.

    printProperties

    If true prints the properties of all entities.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    Some computations may still be running.

  66. def toString(): String

    Returns a short string representation of the property store showing core figures.

    Returns a short string representation of the property store showing core figures.

    Definition Classes
    PropertyStore → AnyRef → Any
  67. final def traceCycleResolutions: Boolean
    Definition Classes
    PropertyStore
  68. final def traceFallbacks: Boolean
    Definition Classes
    PropertyStore
  69. val tracer: Option[PropertyStoreTracer]
  70. var useFastTrackPropertyComputations: Boolean
    Definition Classes
    PropertyStore
  71. def uselessPartialResultComputationCount: Int
  72. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  75. def waitOnPhaseCompletion(): Unit

    Awaits the completion of all property computations which were previously scheduled.

    Awaits the completion of all property computations which were previously scheduled. As soon as all initial computations have finished, dependencies on E/P pairs for which no value was computed and also will not be computed in the future(!) (see setupPhase for details), will be identified and the fallback value will be used. After that, cycle resolution will be performed. I.e., first all _closed_ strongly connected components will be identified that do not contain any properties for which we will compute (in a future phase) any more refined values. Then the values will be made final.

    If the store is suspended, waitOnPhaseCompletion will return as soon as all running computations are finished. By updating the isSuspended state and calling waitOnPhaseCompletion again computations can be continued.

    Definition Classes
    PKEParallelTasksPropertyStorePropertyStore
    Note

    If a second thread is used to register org.opalj.fpcf.PropertyComputation functions no guarantees are given; it is recommended to schedule all property computation functions using one thread and to also use that thread to call this method.

    ,

    If a computation fails with an exception, the property store will stop in due time and return the thrown exception. No strong guarantees are given which exception is returned in case of concurrent execution with multiple exceptions.

    ,

    In case of an exception, the analyses are aborted as fast as possible and the store is no longer usable.

Inherited from PropertyStore

Inherited from AnyRef

Inherited from Any

Ungrouped