Пример #1
0
 public Operation(
     OperationType operationType,
     FailoverPolicy failoverPolicy,
     String keyspaceName,
     Map<String, String> credentials) {
   this.failCounter =
       (operationType == OperationType.READ) ? Counter.READ_FAIL : Counter.WRITE_FAIL;
   this.operationType = operationType;
   this.stopWatchTagName = operationType.name();
   this.failoverPolicy = failoverPolicy;
   this.keyspaceName = keyspaceName;
   this.credentials = Collections.unmodifiableMap(credentials);
 }
    @Nullable
    public GutterIconRenderer createRenderer() {
      if (mySide == ThreeSide.BASE) return null;
      Side versionSide = mySide.select(Side.LEFT, null, Side.RIGHT);
      assert versionSide != null;

      myCtrlPressed = myViewer.getModifierProvider().isCtrlPressed();
      myShiftPressed = myViewer.getModifierProvider().isShiftPressed();

      if (!isChange(versionSide)) return null;

      switch (myType) {
        case APPLY:
          return createApplyRenderer(versionSide, myCtrlPressed);
        case IGNORE:
          return createIgnoreRenderer(versionSide, myCtrlPressed);
        default:
          throw new IllegalArgumentException(myType.name());
      }
    }
Пример #3
0
 public Operation(OperationType operationType) {
   this.failCounter =
       (operationType == OperationType.READ) ? Counter.READ_FAIL : Counter.WRITE_FAIL;
   this.operationType = operationType;
   this.stopWatchTagName = operationType.name();
 }