File tree Expand file tree Collapse file tree
commons/src/main/java/org/apache/ignite/internal/thread/context
main/java/org/apache/ignite/internal
test/java/org/apache/ignite/internal/thread/context Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020import java .util .ArrayList ;
2121import java .util .List ;
22+ import org .apache .ignite .internal .thread .context .concurrent .ContextAwareExecutor ;
2223import org .apache .ignite .internal .util .typedef .F ;
2324import org .jetbrains .annotations .Nullable ;
2425
2526import static org .apache .ignite .internal .thread .context .Scope .NOOP_SCOPE ;
2627
2728/**
28- * Represents a storage of {@link ContextAttribute}s and their corresponding values bound to the thread.
29+ * Represents a storage of {@link ContextAttribute}s and their corresponding values bound to the JVM thread.
2930 * The state of Context is determined by a sequence of {@link Update}s applied to it. Each Update stores the
3031 * updated or newly added {@link ContextAttribute} values and link to the previous Update.
3132 * <pre>
3738 *</pre>
3839 * Context Updates can be undone in the same order they were applied by closing the {@link Scope} associated with each
3940 * update (see {@link #set(ContextAttribute, Object)} and related methods).
41+ *<p>
42+ * Context bound to one JVM thread can be saved and restored in another thread using the snapshot mechanism
43+ * (see {@link #createSnapshot()} and {@link #restoreSnapshot(ContextSnapshot) methods}). This provides basic
44+ * functionality for implementing asynchronous executors that automatically propagate Context data between JVM threads.
45+ *</p>
46+ *
47+ * @see Scope
48+ * @see ContextSnapshot
49+ * @see ContextAwareWrapper
50+ * @see ContextAwareExecutor
4051 */
4152public class Context {
4253 /** */
Original file line number Diff line number Diff line change 4545import org .apache .ignite .internal .processors .security .IgniteSecurity ;
4646import org .apache .ignite .internal .processors .timeout .GridTimeoutProcessor ;
4747import org .apache .ignite .internal .systemview .StripedExecutorTaskViewWalker ;
48- import org .apache .ignite .internal .thread .context . pool .ContextAwareIoPool ;
49- import org .apache .ignite .internal .thread .context . pool .ContextAwareStripedExecutor ;
50- import org .apache .ignite .internal .thread .context . pool .ContextAwareStripedThreadPoolExecutor ;
51- import org .apache .ignite .internal .thread .context . pool .ContextAwareThreadPoolExecutor ;
48+ import org .apache .ignite .internal .thread .pool .ContextAwareIoPool ;
49+ import org .apache .ignite .internal .thread .pool .ContextAwareStripedExecutor ;
50+ import org .apache .ignite .internal .thread .pool .ContextAwareStripedThreadPoolExecutor ;
51+ import org .apache .ignite .internal .thread .pool .ContextAwareThreadPoolExecutor ;
5252import org .apache .ignite .internal .util .StripedExecutor ;
5353import org .apache .ignite .internal .util .tostring .GridToStringExclude ;
5454import org .apache .ignite .internal .util .typedef .F ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package org .apache .ignite .internal .thread .context . pool ;
18+ package org .apache .ignite .internal .thread .pool ;
1919
2020import java .util .concurrent .Executor ;
2121import org .apache .ignite .internal .thread .context .concurrent .ContextAwareExecutor ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package org .apache .ignite .internal .thread .context . pool ;
18+ package org .apache .ignite .internal .thread .pool ;
1919
2020import org .apache .ignite .IgniteLogger ;
2121import org .apache .ignite .internal .thread .context .function .ContextAwareRunnable ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package org .apache .ignite .internal .thread .context . pool ;
18+ package org .apache .ignite .internal .thread .pool ;
1919
2020import org .apache .ignite .internal .thread .context .function .ContextAwareRunnable ;
2121import org .apache .ignite .thread .IgniteStripedThreadPoolExecutor ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package org .apache .ignite .internal .thread .context . pool ;
18+ package org .apache .ignite .internal .thread .pool ;
1919
2020import java .util .Collection ;
2121import java .util .List ;
Original file line number Diff line number Diff line change 2626import java .util .concurrent .ExecutorService ;
2727import java .util .concurrent .LinkedBlockingQueue ;
2828import org .apache .ignite .internal .managers .communication .GridIoPolicy ;
29- import org .apache .ignite .internal .thread .context . pool .ContextAwareStripedExecutor ;
30- import org .apache .ignite .internal .thread .context . pool .ContextAwareStripedThreadPoolExecutor ;
31- import org .apache .ignite .internal .thread .context . pool .ContextAwareThreadPoolExecutor ;
29+ import org .apache .ignite .internal .thread .pool .ContextAwareStripedExecutor ;
30+ import org .apache .ignite .internal .thread .pool .ContextAwareStripedThreadPoolExecutor ;
31+ import org .apache .ignite .internal .thread .pool .ContextAwareThreadPoolExecutor ;
3232import org .apache .ignite .testframework .junits .common .GridCommonAbstractTest ;
3333import org .junit .Test ;
3434
You can’t perform that action at this time.
0 commit comments