• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #244

10 Apr 2024 08:19PM UTC coverage: 77.465% (-0.08%) from 77.549%
#244

push

github

web-flow
Slot supplier interface & fixed-size implementation (#2014)

https://github.com/temporalio/proposals/blob/master/all-sdk/autotuning.md

286 of 388 new or added lines in 25 files covered. (73.71%)

3 existing lines in 3 files now uncovered.

19116 of 24677 relevant lines covered (77.46%)

0.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.23
/temporal-sdk/src/main/java/io/temporal/worker/tuning/SlotReleaseReason.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.worker.tuning;
22

23
import io.temporal.common.Experimental;
24
import javax.annotation.Nullable;
25

26
@Experimental
27
public abstract class SlotReleaseReason {
28
  SlotReleaseReason() {}
1✔
29

30
  public static SlotReleaseReason taskComplete() {
31
    return new TaskComplete();
1✔
32
  }
33

34
  public static SlotReleaseReason neverUsed() {
35
    return new NeverUsed();
1✔
36
  }
37

38
  public static SlotReleaseReason error(Exception exception) {
39
    return new Error(exception);
1✔
40
  }
41

42
  public boolean isError() {
NEW
43
    return false;
×
44
  }
45

46
  /**
47
   * @return the exception that caused the slot to be released, if this is a reason of type {@link
48
   *     Error}.
49
   */
50
  public @Nullable Exception getException() {
NEW
51
    return null;
×
52
  }
53

54
  /** The slot was released because the task was completed (regardless of status). */
55
  public static class TaskComplete extends SlotReleaseReason {}
1✔
56

57
  /** The slot was released because it was never needed. */
58
  public static class NeverUsed extends SlotReleaseReason {}
1✔
59

60
  /**
61
   * The slot was released because some error was encountered before the slot could be used to
62
   * actually process the task.
63
   */
64
  public static class Error extends SlotReleaseReason {
65
    private final Exception exception;
66

67
    private Error(Exception exception) {
1✔
68
      this.exception = exception;
1✔
69
    }
1✔
70

71
    @Override
72
    public boolean isError() {
NEW
73
      return true;
×
74
    }
75

76
    @Override
77
    public Exception getException() {
NEW
78
      return exception;
×
79
    }
80
  }
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc