Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
@InterfaceStability.Evolving
public class AlterConfigOp {

public enum OpType {
SET((byte) 0), DELETE((byte) 1), APPEND((byte) 2), SUBTRACT((byte) 3);

private static final Map<Byte, OpType> OP_TYPES = Collections.unmodifiableMap(
Arrays.stream(values()).collect(Collectors.toMap(OpType::id, Function.identity()))
);

private final byte id;

OpType(final byte id) {
this.id = id;
}

public byte id() {
return id;
}

public static OpType forId(final byte id) {
return OP_TYPES.get(id);
}
}

private final ConfigEntry configEntry;
private final OpType opType;

public AlterConfigOp(ConfigEntry configEntry, OpType operationType) {
this.configEntry = configEntry;
this.opType = operationType;
}

public ConfigEntry configEntry() {
return configEntry;
};

public OpType opType() {
return opType;
};

@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final AlterConfigOp that = (AlterConfigOp) o;
return opType == that.opType &&
Objects.equals(configEntry, that.configEntry);
}

@Override
public int hashCode() {
return Objects.hash(opType, configEntry);
}

@Override
public String toString() {
return "AlterConfigOp{" +
"opType=" + opType +
", configEntry=" + configEntry +
'}';
}
}

Table of Contents

Status

Current state:Accepted

...

Code Block
titlemodifyConfigs
@InterfaceStability.Evolving
public interfaceclass AlterConfigOp {

    public enum OpType {
  ConfigResource resource();
}

public class SetConfigOp extends AlterConfigOp {
  public SetConfigOp(ConfigResource resource, String value);
}

public class DeleteConfigOp extends AlterConfigOp {
  public DeleteConfigOp(SConfigResource resource);
}

public class AppendConfigOp extends AlterConfigOp {
  public AppendConfigOp(ConfigResource resource, String value);
}

public class SubtractConfigOp extends AlterConfigOp {
  public SubtractConfigOp(ConfigResource resource, String value);
}

        SET((byte) 0), DELETE((byte) 1), APPEND((byte) 2), SUBTRACT((byte) 3);

        private static final Map<Byte, OpType> OP_TYPES = Collections.unmodifiableMap(
                Arrays.stream(values()).collect(Collectors.toMap(OpType::id, Function.identity()))
        );

        private final byte id;

        OpType(final byte id) {
            this.id = id;
        }

        public byte id() {
            return id;
        }

        public static OpType forId(final byte id) {
            return OP_TYPES.get(id);
        }
    }

    private final ConfigEntry configEntry;
    private final OpType opType;

    public AlterConfigOp(ConfigEntry configEntry, OpType operationType) {
        this.configEntry = configEntry;
        this.opType =  operationType;
    }

    public ConfigEntry configEntry() {
        return configEntry;
    };

    public OpType opType() {
        return opType;
    };
}


public IncrementalAlterConfigsResult incrementalAlterConfigs(
		Map<ConfigResource, Collection<AlterConfigOp>> configs,
   Collection<AlterConfigOp> ops,
    final IncrementalAlterConfigsOptions options);

...