Skip to content

Commit

Permalink
Remove usages of lombok (apache#12447)
Browse files Browse the repository at this point in the history
  • Loading branch information
gortiz authored Feb 20, 2024
1 parent 9f57e17 commit 8c395ff
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 56 deletions.
21 changes: 0 additions & 21 deletions lombok.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@

import io.netty.handler.ssl.SslProvider;
import java.security.KeyStore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;


/**
* Container object for TLS/SSL configuration of pinot clients and servers (netty, grizzly, etc.)
*/
@Getter
@Setter
@EqualsAndHashCode
public class TlsConfig {
private boolean _clientAuthEnabled;
private String _keyStoreType = KeyStore.getDefaultType();
Expand Down Expand Up @@ -59,7 +54,101 @@ public TlsConfig(TlsConfig tlsConfig) {
_sslProvider = tlsConfig._sslProvider;
}

public boolean isClientAuthEnabled() {
return _clientAuthEnabled;
}

public void setClientAuthEnabled(boolean clientAuthEnabled) {
_clientAuthEnabled = clientAuthEnabled;
}

public String getKeyStoreType() {
return _keyStoreType;
}

public void setKeyStoreType(String keyStoreType) {
_keyStoreType = keyStoreType;
}

public String getKeyStorePath() {
return _keyStorePath;
}

public void setKeyStorePath(String keyStorePath) {
_keyStorePath = keyStorePath;
}

public String getKeyStorePassword() {
return _keyStorePassword;
}

public void setKeyStorePassword(String keyStorePassword) {
_keyStorePassword = keyStorePassword;
}

public String getTrustStoreType() {
return _trustStoreType;
}

public void setTrustStoreType(String trustStoreType) {
_trustStoreType = trustStoreType;
}

public String getTrustStorePath() {
return _trustStorePath;
}

public void setTrustStorePath(String trustStorePath) {
_trustStorePath = trustStorePath;
}

public String getTrustStorePassword() {
return _trustStorePassword;
}

public void setTrustStorePassword(String trustStorePassword) {
_trustStorePassword = trustStorePassword;
}

public String getSslProvider() {
return _sslProvider;
}

public void setSslProvider(String sslProvider) {
_sslProvider = sslProvider;
}

public boolean isCustomized() {
return StringUtils.isNoneBlank(_keyStorePath) || StringUtils.isNoneBlank(_trustStorePath);
}

public boolean isInsecure() {
return _insecure;
}

public void setInsecure(boolean insecure) {
_insecure = insecure;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TlsConfig tlsConfig = (TlsConfig) o;
return _clientAuthEnabled == tlsConfig._clientAuthEnabled && _insecure == tlsConfig._insecure && Objects.equals(
_keyStoreType, tlsConfig._keyStoreType) && Objects.equals(_keyStorePath, tlsConfig._keyStorePath)
&& Objects.equals(_keyStorePassword, tlsConfig._keyStorePassword) && Objects.equals(_trustStoreType,
tlsConfig._trustStoreType) && Objects.equals(_trustStorePath, tlsConfig._trustStorePath) && Objects.equals(
_trustStorePassword, tlsConfig._trustStorePassword) && Objects.equals(_sslProvider, tlsConfig._sslProvider);
}

@Override
public int hashCode() {
return Objects.hash(_clientAuthEnabled, _keyStoreType, _keyStorePath, _keyStorePassword, _trustStoreType,
_trustStorePath, _trustStorePassword, _sslProvider, _insecure);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.apache.pinot.segment.spi.index.reader.ForwardIndexReader;
import org.apache.pinot.segment.spi.index.reader.ForwardIndexReaderContext;
import org.apache.pinot.segment.spi.memory.CleanerUtil;
Expand All @@ -41,15 +39,10 @@
* </ul>
*/
public class ChunkReaderContext implements ForwardIndexReaderContext {
@Getter
private final ByteBuffer _chunkBuffer;

@Getter
@Setter
private int _chunkId;

@Getter
@Setter
private List<ForwardIndexReader.ByteRange> _ranges;

public ChunkReaderContext(int maxChunkSize) {
Expand All @@ -65,4 +58,24 @@ public void close()
CleanerUtil.getCleaner().freeBuffer(_chunkBuffer);
}
}

public ByteBuffer getChunkBuffer() {
return _chunkBuffer;
}

public int getChunkId() {
return _chunkId;
}

public void setChunkId(int chunkId) {
_chunkId = chunkId;
}

public List<ForwardIndexReader.ByteRange> getRanges() {
return _ranges;
}

public void setRanges(List<ForwardIndexReader.ByteRange> ranges) {
_ranges = ranges;
}
}
4 changes: 0 additions & 4 deletions pinot-segment-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<!-- test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.apache.pinot.segment.spi.compression.ChunkCompressionType;
import org.apache.pinot.segment.spi.compression.DictIdCompressionType;
import org.apache.pinot.segment.spi.index.IndexReader;
Expand Down Expand Up @@ -990,13 +988,40 @@ default boolean isDocLengthInBits() {
/**
* This class represents the buffer byte ranges accessed while reading a given docId.
*/
@AllArgsConstructor
@EqualsAndHashCode
@Getter
class ByteRange {
private final long _offset;
private final int _sizeInBytes;

public ByteRange(long offset, int sizeInBytes) {
_offset = offset;
_sizeInBytes = sizeInBytes;
}

public long getOffset() {
return _offset;
}

public int getSizeInBytes() {
return _sizeInBytes;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ByteRange byteRange = (ByteRange) o;
return _offset == byteRange._offset && _sizeInBytes == byteRange._sizeInBytes;
}

@Override
public int hashCode() {
return Objects.hash(_offset, _sizeInBytes);
}

@Override
public String toString() {
return "Range{" + "_offset=" + _offset + ", _size=" + _sizeInBytes + '}';
Expand Down
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1313,18 +1313,6 @@
<artifactId>test-clock</artifactId>
<version>1.0.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- starting from 1.18.30, JDK21 is supported -->
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 8c395ff

Please sign in to comment.