From 10928d5ba5b09ab7242ca9fa8d530634fc80cd38 Mon Sep 17 00:00:00 2001 From: Zixuan Liu Date: Thu, 24 Oct 2024 22:52:23 +0800 Subject: [PATCH 1/2] [feat] Build pulsar-sql based on pulsar 4.0.0 --- .gitignore | 3 + pulsar-sql/pom.xml | 40 +- pulsar-sql/presto-distribution/pom.xml | 18 +- pulsar-sql/presto-pulsar-plugin/pom.xml | 2 +- pulsar-sql/presto-pulsar/pom.xml | 9 +- .../pulsar/sql/presto/PulsarRecordCursor.java | 15 +- .../apache/pulsar/sql/presto/PulsarSplit.java | 15 +- .../pulsar/sql/presto/PulsarSplitManager.java | 37 +- .../sql/presto/TestCacheSizeAllocator.java | 11 +- .../sql/presto/TestPulsarConnector.java | 16 +- .../sql/presto/TestPulsarRecordCursor.java | 15 +- .../sql/presto/TestPulsarSplitManager.java | 18 +- .../sql/presto/TestReadChunkedMessages.java | 4 +- pulsar-sql/src/checkstyle.xml | 434 ++++++++++++++++++ pulsar-sql/src/license-header.txt | 16 + pulsar-sql/src/suppressions.xml | 87 ++++ 16 files changed, 651 insertions(+), 89 deletions(-) create mode 100644 .gitignore create mode 100644 pulsar-sql/src/checkstyle.xml create mode 100644 pulsar-sql/src/license-header.txt create mode 100644 pulsar-sql/src/suppressions.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e7948a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +target/ +dependency-reduced-pom.xml diff --git a/pulsar-sql/pom.xml b/pulsar-sql/pom.xml index 22a4730..6e76c5b 100644 --- a/pulsar-sql/pom.xml +++ b/pulsar-sql/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar pulsar - 3.0.8-SNAPSHOT + 4.0.0 pulsar-sql @@ -37,6 +37,7 @@ 1.17.2 213 + 368 @@ -106,18 +107,45 @@ - org.apache.maven.plugins - maven-checkstyle-plugin + org.commonjava.maven.plugins + directory-maven-plugin + ${directory-maven-plugin.version} - checkstyle - verify + directories - check + directory-of + initialize + + pulsar.basedir + + org.apache.pulsar + pulsar-sql + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven-checkstyle-plugin.version} + + + com.puppycrawl.tools + checkstyle + ${puppycrawl.checkstyle.version} + + + + ${pulsar.basedir}/src/checkstyle.xml + ${pulsar.basedir}/src/suppressions.xml + true + UTF-8 + **/proto/* + + diff --git a/pulsar-sql/presto-distribution/pom.xml b/pulsar-sql/presto-distribution/pom.xml index e327149..a69c35f 100644 --- a/pulsar-sql/presto-distribution/pom.xml +++ b/pulsar-sql/presto-distribution/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar pulsar-sql - 3.0.8-SNAPSHOT + 4.0.0 pulsar-presto-distribution @@ -329,22 +329,6 @@ - - - com.mycila - license-maven-plugin - ${license-maven-plugin.version} - - - -
../../src/license-header.txt
-
-
- - SLASHSTAR_STYLE - -
-
diff --git a/pulsar-sql/presto-pulsar-plugin/pom.xml b/pulsar-sql/presto-pulsar-plugin/pom.xml index 806399d..6d21e38 100644 --- a/pulsar-sql/presto-pulsar-plugin/pom.xml +++ b/pulsar-sql/presto-pulsar-plugin/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar pulsar-sql - 3.0.8-SNAPSHOT + 4.0.0 pulsar-presto-connector diff --git a/pulsar-sql/presto-pulsar/pom.xml b/pulsar-sql/presto-pulsar/pom.xml index 9699c39..eba48c3 100644 --- a/pulsar-sql/presto-pulsar/pom.xml +++ b/pulsar-sql/presto-pulsar/pom.xml @@ -25,7 +25,7 @@ org.apache.pulsar pulsar-sql - 3.0.8-SNAPSHOT + 4.0.0 pulsar-presto-connector-original @@ -143,6 +143,13 @@ test + + org.apache.pulsar + managed-ledger + ${project.version} + test + + org.apache.pulsar testmocks diff --git a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java index 07f2d5a..b3934d5 100644 --- a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java +++ b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java @@ -23,6 +23,7 @@ import static io.airlift.slice.SizeOf.SIZE_OF_LONG; import static io.trino.decoder.FieldValueProviders.bytesValueProvider; import static io.trino.decoder.FieldValueProviders.longValueProvider; +import static org.apache.bookkeeper.mledger.PositionFactory.LATEST; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.annotations.VisibleForTesting; @@ -48,6 +49,7 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; @@ -58,7 +60,6 @@ import org.apache.bookkeeper.mledger.ManagedLedgerFactory; import org.apache.bookkeeper.mledger.Position; import org.apache.bookkeeper.mledger.ReadOnlyCursor; -import org.apache.bookkeeper.mledger.impl.PositionImpl; import org.apache.bookkeeper.mledger.impl.ReadOnlyCursorImpl; import org.apache.pulsar.client.api.PulsarClientException; import org.apache.pulsar.client.api.Schema; @@ -75,7 +76,6 @@ import org.apache.pulsar.common.schema.KeyValueEncodingType; import org.apache.pulsar.common.schema.SchemaInfo; import org.apache.pulsar.common.schema.SchemaType; -import org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap; import org.apache.pulsar.sql.presto.util.CacheSizeAllocator; import org.apache.pulsar.sql.presto.util.NoStrictCacheSizeAllocator; import org.apache.pulsar.sql.presto.util.NullCacheSizeAllocator; @@ -123,8 +123,7 @@ public class PulsarRecordCursor implements RecordCursor { PulsarDispatchingRowDecoderFactory decoderFactory; - protected ConcurrentOpenHashMap chunkedMessagesMap = - ConcurrentOpenHashMap.newBuilder().build(); + protected ConcurrentHashMap chunkedMessagesMap = new ConcurrentHashMap<>(); private static final Logger log = Logger.get(PulsarRecordCursor.class); @@ -366,7 +365,7 @@ public void accept(Entry entry) { } private boolean entryExceedSplitEndPosition(Entry entry) { - return ((PositionImpl) entry.getPosition()).compareTo(pulsarSplit.getEndPosition()) >= 0; + return entry.getPosition().compareTo(pulsarSplit.getEndPosition()) >= 0; } @VisibleForTesting @@ -383,7 +382,7 @@ public void run() { if (outstandingReadsRequests.get() > 0) { if (!cursor.hasMoreEntries() - || (((PositionImpl) cursor.getReadPosition()).compareTo(pulsarSplit.getEndPosition()) >= 0 + || (cursor.getReadPosition().compareTo(pulsarSplit.getEndPosition()) >= 0 && chunkedMessagesMap.isEmpty())) { isDone = true; @@ -401,7 +400,7 @@ public void run() { long numEntries = readOnlyCursorImpl.getCurrentLedgerInfo().getEntries(); long entriesToSkip = - (numEntries - ((PositionImpl) cursor.getReadPosition()).getEntryId()) + 1; + (numEntries - (cursor.getReadPosition()).getEntryId()) + 1; cursor.skipEntries(Math.toIntExact((entriesToSkip))); entriesProcessed += entriesToSkip; @@ -413,7 +412,7 @@ public void run() { // if the available size is invalid and the entry queue size is 0, read one entry outstandingReadsRequests.decrementAndGet(); cursor.asyncReadEntries(batchSize, entryQueueCacheSizeAllocator.getAvailableCacheSize(), - this, System.nanoTime(), PositionImpl.LATEST); + this, System.nanoTime(), LATEST); } // stats for successful read request diff --git a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplit.java b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplit.java index 1967ec5..b23a971 100644 --- a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplit.java +++ b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplit.java @@ -31,7 +31,8 @@ import java.io.IOException; import java.util.List; import java.util.Map; -import org.apache.bookkeeper.mledger.impl.PositionImpl; +import org.apache.bookkeeper.mledger.Position; +import org.apache.bookkeeper.mledger.impl.ImmutablePositionImpl; import org.apache.pulsar.common.policies.data.OffloadPoliciesImpl; import org.apache.pulsar.common.schema.SchemaInfo; import org.apache.pulsar.common.schema.SchemaType; @@ -58,8 +59,8 @@ public class PulsarSplit implements ConnectorSplit { private final TupleDomain tupleDomain; private final SchemaInfo schemaInfo; - private final PositionImpl startPosition; - private final PositionImpl endPosition; + private final Position startPosition; + private final Position endPosition; private final String schemaInfoProperties; private final OffloadPoliciesImpl offloadPolicies; @@ -95,8 +96,8 @@ public PulsarSplit( this.startPositionLedgerId = startPositionLedgerId; this.endPositionLedgerId = endPositionLedgerId; this.tupleDomain = requireNonNull(tupleDomain, "tupleDomain is null"); - this.startPosition = PositionImpl.get(startPositionLedgerId, startPositionEntryId); - this.endPosition = PositionImpl.get(endPositionLedgerId, endPositionEntryId); + this.startPosition = new ImmutablePositionImpl(startPositionLedgerId, startPositionEntryId); + this.endPosition = new ImmutablePositionImpl(endPositionLedgerId, endPositionEntryId); this.schemaInfoProperties = schemaInfoProperties; this.offloadPolicies = offloadPolicies; @@ -174,11 +175,11 @@ public TupleDomain getTupleDomain() { return tupleDomain; } - public PositionImpl getStartPosition() { + public Position getStartPosition() { return startPosition; } - public PositionImpl getEndPosition() { + public Position getEndPosition() { return endPosition; } diff --git a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java index 464e70b..b092bf8 100644 --- a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java +++ b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java @@ -22,6 +22,7 @@ import static io.trino.spi.StandardErrorCode.QUERY_REJECTED; import static java.util.Objects.requireNonNull; import static org.apache.bookkeeper.mledger.ManagedCursor.FindPositionConstraint.SearchAllAvailableEntries; +import static org.apache.bookkeeper.mledger.PositionFactory.EARLIEST; import static org.apache.pulsar.sql.presto.PulsarConnectorUtils.restoreNamespaceDelimiterIfNeeded; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.annotations.VisibleForTesting; @@ -50,8 +51,8 @@ import org.apache.bookkeeper.mledger.ManagedLedgerConfig; import org.apache.bookkeeper.mledger.ManagedLedgerException; import org.apache.bookkeeper.mledger.ManagedLedgerFactory; +import org.apache.bookkeeper.mledger.Position; import org.apache.bookkeeper.mledger.ReadOnlyCursor; -import org.apache.bookkeeper.mledger.impl.PositionImpl; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.admin.PulsarAdminException; @@ -271,7 +272,7 @@ Collection getSplitsForTopic(String topicNamePersistenceEncoding, try { readOnlyCursor = managedLedgerFactory.openReadOnlyCursor( topicNamePersistenceEncoding, - PositionImpl.EARLIEST, managedLedgerConfig); + EARLIEST, managedLedgerConfig); long numEntries = readOnlyCursor.getNumberOfEntries(); if (numEntries <= 0) { @@ -286,12 +287,12 @@ Collection getSplitsForTopic(String topicNamePersistenceEncoding, topicNamePersistenceEncoding, numEntries); - PositionImpl initialStartPosition; + Position initialStartPosition; if (predicatePushdownInfo != null) { numEntries = predicatePushdownInfo.getNumOfEntries(); initialStartPosition = predicatePushdownInfo.getStartPosition(); } else { - initialStartPosition = (PositionImpl) readOnlyCursor.getReadPosition(); + initialStartPosition = readOnlyCursor.getReadPosition(); } @@ -307,9 +308,9 @@ Collection getSplitsForTopic(String topicNamePersistenceEncoding, List splits = new LinkedList<>(); for (int i = 0; i < numSplits; i++) { long entriesForSplit = (remainder > i) ? avgEntriesPerSplit + 1 : avgEntriesPerSplit; - PositionImpl startPosition = (PositionImpl) readOnlyCursor.getReadPosition(); + Position startPosition = readOnlyCursor.getReadPosition(); readOnlyCursor.skipEntries(Math.toIntExact(entriesForSplit)); - PositionImpl endPosition = (PositionImpl) readOnlyCursor.getReadPosition(); + Position endPosition = readOnlyCursor.getReadPosition(); PulsarSplit pulsarSplit = new PulsarSplit(i, this.connectorId, restoreNamespaceDelimiterIfNeeded(tableHandle.getSchemaName(), pulsarConnectorConfig), @@ -341,11 +342,11 @@ Collection getSplitsForTopic(String topicNamePersistenceEncoding, @Data private static class PredicatePushdownInfo { - private PositionImpl startPosition; - private PositionImpl endPosition; + private Position startPosition; + private Position endPosition; private long numOfEntries; - private PredicatePushdownInfo(PositionImpl startPosition, PositionImpl endPosition, long numOfEntries) { + private PredicatePushdownInfo(Position startPosition, Position endPosition, long numOfEntries) { this.startPosition = startPosition; this.endPosition = endPosition; this.numOfEntries = numOfEntries; @@ -363,7 +364,7 @@ public static PredicatePushdownInfo getPredicatePushdownInfo(String connectorId, try { readOnlyCursor = managedLedgerFactory.openReadOnlyCursor( topicNamePersistenceEncoding, - PositionImpl.EARLIEST, managedLedgerConfig); + EARLIEST, managedLedgerConfig); if (tupleDomain.getDomains().isPresent()) { Domain domain = tupleDomain.getDomains().get().get(PulsarInternalColumn.PUBLISH_TIME @@ -390,20 +391,20 @@ public static PredicatePushdownInfo getPredicatePushdownInfo(String connectorId, lowerBoundTs = block.getLong(0, 0) / 1000; } - PositionImpl overallStartPos; + Position overallStartPos; if (lowerBoundTs == null) { - overallStartPos = (PositionImpl) readOnlyCursor.getReadPosition(); + overallStartPos = readOnlyCursor.getReadPosition(); } else { overallStartPos = findPosition(readOnlyCursor, lowerBoundTs); if (overallStartPos == null) { - overallStartPos = (PositionImpl) readOnlyCursor.getReadPosition(); + overallStartPos = readOnlyCursor.getReadPosition(); } } - PositionImpl overallEndPos; + Position overallEndPos; if (upperBoundTs == null) { readOnlyCursor.skipEntries(Math.toIntExact(totalNumEntries)); - overallEndPos = (PositionImpl) readOnlyCursor.getReadPosition(); + overallEndPos = readOnlyCursor.getReadPosition(); } else { overallEndPos = findPosition(readOnlyCursor, upperBoundTs); if (overallEndPos == null) { @@ -414,7 +415,7 @@ public static PredicatePushdownInfo getPredicatePushdownInfo(String connectorId, // Just use a close bound since presto can always filter out the extra entries even if // the bound // should be open or a mixture of open and closed - com.google.common.collect.Range posRange = + com.google.common.collect.Range posRange = com.google.common.collect.Range.range(overallStartPos, com.google.common.collect.BoundType.CLOSED, overallEndPos, com.google.common.collect.BoundType.CLOSED); @@ -437,10 +438,10 @@ public static PredicatePushdownInfo getPredicatePushdownInfo(String connectorId, } } - private static PositionImpl findPosition(ReadOnlyCursor readOnlyCursor, long timestamp) throws + private static Position findPosition(ReadOnlyCursor readOnlyCursor, long timestamp) throws ManagedLedgerException, InterruptedException { - return (PositionImpl) readOnlyCursor.findNewestMatching( + return readOnlyCursor.findNewestMatching( SearchAllAvailableEntries, entry -> { try { diff --git a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestCacheSizeAllocator.java b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestCacheSizeAllocator.java index 716cd2c..a14d71a 100644 --- a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestCacheSizeAllocator.java +++ b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestCacheSizeAllocator.java @@ -29,8 +29,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.bookkeeper.mledger.Entry; import org.apache.bookkeeper.mledger.ManagedLedgerConfig; +import org.apache.bookkeeper.mledger.Position; import org.apache.bookkeeper.mledger.ReadOnlyCursor; -import org.apache.bookkeeper.mledger.impl.PositionImpl; +import org.apache.bookkeeper.mledger.impl.ImmutablePositionImpl; import org.apache.bookkeeper.stats.NullStatsProvider; import org.apache.commons.lang3.RandomUtils; import org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest; @@ -90,12 +91,12 @@ public void cacheSizeAllocatorTest(long entryQueueSizeBytes) throws Exception { int totalMsgCnt = 1000; MessageIdImpl firstMessageId = prepareData(topicName, totalMsgCnt); - ReadOnlyCursor readOnlyCursor = pulsar.getManagedLedgerFactory().openReadOnlyCursor( + ReadOnlyCursor readOnlyCursor = pulsar.getDefaultManagedLedgerFactory().openReadOnlyCursor( topicName.getPersistenceNamingEncoding(), - PositionImpl.get(firstMessageId.getLedgerId(), firstMessageId.getEntryId()), + new ImmutablePositionImpl(firstMessageId.getLedgerId(), firstMessageId.getEntryId()), new ManagedLedgerConfig()); readOnlyCursor.skipEntries(totalMsgCnt); - PositionImpl lastPosition = (PositionImpl) readOnlyCursor.getReadPosition(); + Position lastPosition = readOnlyCursor.getReadPosition(); ObjectMapper objectMapper = new ObjectMapper(); @@ -124,7 +125,7 @@ public void cacheSizeAllocatorTest(long entryQueueSizeBytes) throws Exception { ConnectorContext prestoConnectorContext = new TestingConnectorContext(); PulsarRecordCursor pulsarRecordCursor = new PulsarRecordCursor( - pulsarColumnHandles, pulsarSplit, connectorConfig, pulsar.getManagedLedgerFactory(), + pulsarColumnHandles, pulsarSplit, connectorConfig, pulsar.getDefaultManagedLedgerFactory(), new ManagedLedgerConfig(), new PulsarConnectorMetricsTracker(new NullStatsProvider()), new PulsarDispatchingRowDecoderFactory(prestoConnectorContext.getTypeManager())); diff --git a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnector.java b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnector.java index 61f6edd..c01798f 100644 --- a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnector.java +++ b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnector.java @@ -59,7 +59,7 @@ import org.apache.bookkeeper.mledger.Position; import org.apache.bookkeeper.mledger.ReadOnlyCursor; import org.apache.bookkeeper.mledger.impl.EntryImpl; -import org.apache.bookkeeper.mledger.impl.PositionImpl; +import org.apache.bookkeeper.mledger.impl.ImmutablePositionImpl; import org.apache.bookkeeper.mledger.impl.ReadOnlyCursorImpl; import org.apache.bookkeeper.mledger.proto.MLDataFormats; import org.apache.bookkeeper.stats.NullStatsProvider; @@ -559,7 +559,7 @@ public SchemaInfo answer(InvocationOnMock invocationOnMock) throws Throwable { public ReadOnlyCursor answer(InvocationOnMock invocationOnMock) throws Throwable { Object[] args = invocationOnMock.getArguments(); String topic = (String) args[0]; - PositionImpl positionImpl = (PositionImpl) args[1]; + Position positionImpl = (Position) args[1]; int position = positionImpl.getEntryId() == -1 ? 0 : (int) positionImpl.getEntryId(); @@ -584,10 +584,10 @@ public Void answer(InvocationOnMock invocation) throws Throwable { } }).when(readOnlyCursor).skipEntries(anyInt()); - when(readOnlyCursor.getReadPosition()).thenAnswer(new Answer() { + when(readOnlyCursor.getReadPosition()).thenAnswer(new Answer() { @Override - public PositionImpl answer(InvocationOnMock invocationOnMock) throws Throwable { - return PositionImpl.get(0, positions.get(topic)); + public Position answer(InvocationOnMock invocationOnMock) throws Throwable { + return new ImmutablePositionImpl(0, positions.get(topic)); } }); @@ -681,7 +681,7 @@ public Position answer(InvocationOnMock invocationOnMock) throws Throwable { } } - return target == null ? null : new PositionImpl(0, target); + return target == null ? null : new ImmutablePositionImpl(0, target); } }); @@ -689,8 +689,8 @@ public Position answer(InvocationOnMock invocationOnMock) throws Throwable { @Override public Long answer(InvocationOnMock invocationOnMock) throws Throwable { Object[] args = invocationOnMock.getArguments(); - com.google.common.collect.Range range - = (com.google.common.collect.Range ) args[0]; + com.google.common.collect.Range range + = (com.google.common.collect.Range ) args[0]; return (range.upperEndpoint().getEntryId() + 1) - range.lowerEndpoint().getEntryId(); } diff --git a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarRecordCursor.java b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarRecordCursor.java index 40ced8e..4f68799 100644 --- a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarRecordCursor.java +++ b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarRecordCursor.java @@ -59,9 +59,10 @@ import org.apache.bookkeeper.mledger.Entry; import org.apache.bookkeeper.mledger.ManagedLedgerConfig; import org.apache.bookkeeper.mledger.ManagedLedgerFactory; +import org.apache.bookkeeper.mledger.Position; import org.apache.bookkeeper.mledger.ReadOnlyCursor; import org.apache.bookkeeper.mledger.impl.EntryImpl; -import org.apache.bookkeeper.mledger.impl.PositionImpl; +import org.apache.bookkeeper.mledger.impl.ImmutablePositionImpl; import org.apache.bookkeeper.mledger.impl.ReadOnlyCursorImpl; import org.apache.bookkeeper.mledger.proto.MLDataFormats; import org.apache.bookkeeper.stats.NullStatsProvider; @@ -312,7 +313,7 @@ private PulsarRecordCursor mockKeyValueSchemaPulsarRecordCursor(final Long entri public ReadOnlyCursor answer(InvocationOnMock invocationOnMock) throws Throwable { Object[] args = invocationOnMock.getArguments(); String topic = (String) args[0]; - PositionImpl positionImpl = (PositionImpl) args[1]; + Position positionImpl = (Position) args[1]; int position = positionImpl.getEntryId() == -1 ? 0 : (int) positionImpl.getEntryId(); positions.put(topic, position); @@ -329,10 +330,10 @@ public Void answer(InvocationOnMock invocation) throws Throwable { } }).when(readOnlyCursor).skipEntries(anyInt()); - when(readOnlyCursor.getReadPosition()).thenAnswer(new Answer() { + when(readOnlyCursor.getReadPosition()).thenAnswer(new Answer() { @Override - public PositionImpl answer(InvocationOnMock invocationOnMock) throws Throwable { - return PositionImpl.get(0, positions.get(topic)); + public Position answer(InvocationOnMock invocationOnMock) throws Throwable { + return new ImmutablePositionImpl(0, positions.get(topic)); } }); @@ -397,8 +398,8 @@ public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { @Override public Long answer(InvocationOnMock invocationOnMock) throws Throwable { Object[] args = invocationOnMock.getArguments(); - com.google.common.collect.Range range - = (com.google.common.collect.Range) args[0]; + com.google.common.collect.Range range + = (com.google.common.collect.Range) args[0]; return (range.upperEndpoint().getEntryId() + 1) - range.lowerEndpoint().getEntryId(); } }); diff --git a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarSplitManager.java b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarSplitManager.java index 86b2ee5..adab9ae 100644 --- a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarSplitManager.java +++ b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestPulsarSplitManager.java @@ -30,7 +30,7 @@ import io.trino.spi.predicate.Range; import io.trino.spi.predicate.TupleDomain; import io.trino.spi.predicate.ValueSet; -import org.apache.bookkeeper.mledger.impl.PositionImpl; +import org.apache.bookkeeper.mledger.impl.ImmutablePositionImpl; import org.apache.pulsar.client.impl.schema.JSONSchema; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.policies.data.OffloadPoliciesImpl; @@ -116,10 +116,10 @@ public void testTopic(String delimiter) throws Exception { assertEquals(pulsarSplit.getSchemaType(), topicsToSchemas.get(topicName.getSchemaName()).getType()); assertEquals(pulsarSplit.getStartPositionEntryId(), totalSize); assertEquals(pulsarSplit.getStartPositionLedgerId(), 0); - assertEquals(pulsarSplit.getStartPosition(), PositionImpl.get(0, totalSize)); + assertEquals(pulsarSplit.getStartPosition(), new ImmutablePositionImpl(0, totalSize)); assertEquals(pulsarSplit.getEndPositionLedgerId(), 0); assertEquals(pulsarSplit.getEndPositionEntryId(), totalSize + pulsarSplit.getSplitSize()); - assertEquals(pulsarSplit.getEndPosition(), PositionImpl.get(0, totalSize + pulsarSplit.getSplitSize())); + assertEquals(pulsarSplit.getEndPosition(), new ImmutablePositionImpl(0, totalSize + pulsarSplit.getSplitSize())); totalSize += pulsarSplit.getSplitSize(); } @@ -165,10 +165,10 @@ public void testPartitionedTopic(String delimiter) throws Exception { assertEquals(pulsarSplit.getSchemaType(), topicsToSchemas.get(topicName.getSchemaName()).getType()); assertEquals(pulsarSplit.getStartPositionEntryId(), totalSize); assertEquals(pulsarSplit.getStartPositionLedgerId(), 0); - assertEquals(pulsarSplit.getStartPosition(), PositionImpl.get(0, totalSize)); + assertEquals(pulsarSplit.getStartPosition(), new ImmutablePositionImpl(0, totalSize)); assertEquals(pulsarSplit.getEndPositionLedgerId(), 0); assertEquals(pulsarSplit.getEndPositionEntryId(), totalSize + pulsarSplit.getSplitSize()); - assertEquals(pulsarSplit.getEndPosition(), PositionImpl.get(0, totalSize + pulsarSplit.getSplitSize())); + assertEquals(pulsarSplit.getEndPosition(), new ImmutablePositionImpl(0, totalSize + pulsarSplit.getSplitSize())); totalSize += pulsarSplit.getSplitSize(); } @@ -231,10 +231,10 @@ public void testPublishTimePredicatePushdown(String delimiter) throws Exception assertEquals(pulsarSplit.getSchemaType(), topicsToSchemas.get(topicName.getSchemaName()).getType()); assertEquals(pulsarSplit.getStartPositionEntryId(), initalStart); assertEquals(pulsarSplit.getStartPositionLedgerId(), 0); - assertEquals(pulsarSplit.getStartPosition(), PositionImpl.get(0, initalStart)); + assertEquals(pulsarSplit.getStartPosition(), new ImmutablePositionImpl(0, initalStart)); assertEquals(pulsarSplit.getEndPositionLedgerId(), 0); assertEquals(pulsarSplit.getEndPositionEntryId(), initalStart + pulsarSplit.getSplitSize()); - assertEquals(pulsarSplit.getEndPosition(), PositionImpl.get(0, initalStart + pulsarSplit + assertEquals(pulsarSplit.getEndPosition(), new ImmutablePositionImpl(0, initalStart + pulsarSplit .getSplitSize())); initalStart += pulsarSplit.getSplitSize(); @@ -292,10 +292,10 @@ public void testPublishTimePredicatePushdownPartitionedTopic(String delimiter) t assertEquals(pulsarSplit.getSchemaType(), topicsToSchemas.get(topicName.getSchemaName()).getType()); assertEquals(pulsarSplit.getStartPositionEntryId(), initialStart); assertEquals(pulsarSplit.getStartPositionLedgerId(), 0); - assertEquals(pulsarSplit.getStartPosition(), PositionImpl.get(0, initialStart)); + assertEquals(pulsarSplit.getStartPosition(), new ImmutablePositionImpl(0, initialStart)); assertEquals(pulsarSplit.getEndPositionLedgerId(), 0); assertEquals(pulsarSplit.getEndPositionEntryId(), initialStart + pulsarSplit.getSplitSize()); - assertEquals(pulsarSplit.getEndPosition(), PositionImpl.get(0, initialStart + pulsarSplit.getSplitSize())); + assertEquals(pulsarSplit.getEndPosition(), new ImmutablePositionImpl(0, initialStart + pulsarSplit.getSplitSize())); initialStart += pulsarSplit.getSplitSize(); totalSize += pulsarSplit.getSplitSize(); diff --git a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestReadChunkedMessages.java b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestReadChunkedMessages.java index 1e959e9..8252c1a 100644 --- a/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestReadChunkedMessages.java +++ b/pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestReadChunkedMessages.java @@ -108,7 +108,7 @@ public void queryTest() throws Exception { PulsarSplitManager pulsarSplitManager = new PulsarSplitManager(new PulsarConnectorId("1"), connectorConfig); Collection splits = pulsarSplitManager.getSplitsForTopic( topicName.getPersistenceNamingEncoding(), - pulsar.getManagedLedgerFactory(), + pulsar.getDefaultManagedLedgerFactory(), new ManagedLedgerConfig(), 3, new PulsarTableHandle("1", topicName.getNamespace(), topic, topic), @@ -177,7 +177,7 @@ private void queryAndCheck(List columnHandleList, ConnectorContext prestoConnectorContext, Set messageSet) { PulsarRecordCursor pulsarRecordCursor = new PulsarRecordCursor( - columnHandleList, split, connectorConfig, pulsar.getManagedLedgerFactory(), + columnHandleList, split, connectorConfig, pulsar.getDefaultManagedLedgerFactory(), new ManagedLedgerConfig(), new PulsarConnectorMetricsTracker(new NullStatsProvider()), new PulsarDispatchingRowDecoderFactory(prestoConnectorContext.getTypeManager())); diff --git a/pulsar-sql/src/checkstyle.xml b/pulsar-sql/src/checkstyle.xml new file mode 100644 index 0000000..14808cf --- /dev/null +++ b/pulsar-sql/src/checkstyle.xml @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pulsar-sql/src/license-header.txt b/pulsar-sql/src/license-header.txt new file mode 100644 index 0000000..60b675e --- /dev/null +++ b/pulsar-sql/src/license-header.txt @@ -0,0 +1,16 @@ +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. diff --git a/pulsar-sql/src/suppressions.xml b/pulsar-sql/src/suppressions.xml new file mode 100644 index 0000000..57a01c6 --- /dev/null +++ b/pulsar-sql/src/suppressions.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From af4dcb437fb4cf6cadba5ccc48c04a4c39067979 Mon Sep 17 00:00:00 2001 From: Zixuan Liu Date: Fri, 25 Oct 2024 13:18:18 +0800 Subject: [PATCH 2/2] [improve] Move pulsar-sql/* to the root --- pulsar-sql/pom.xml => pom.xml | 29 ++++--------------- .../LICENSE | 0 .../pom.xml | 0 .../src/assembly/assembly.xml | 0 .../org/openjdk/jol/info/ClassLayout.java | 0 .../org/openjdk/jol/info/package-info.java | 0 .../resources/conf/catalog/pulsar.properties | 0 .../src/main/resources/conf/config.properties | 0 .../src/main/resources/conf/jvm.config | 0 .../src/main/resources/conf/log.properties | 0 .../src/main/resources/launcher.properties | 0 .../pom.xml | 0 .../src/assembly/assembly.xml | 0 .../presto-pulsar => presto-pulsar}/pom.xml | 0 .../apache/pulsar/sql/presto/PulsarAuth.java | 0 .../pulsar/sql/presto/PulsarColumnHandle.java | 0 .../sql/presto/PulsarColumnMetadata.java | 0 .../pulsar/sql/presto/PulsarConnector.java | 0 .../sql/presto/PulsarConnectorCache.java | 0 .../sql/presto/PulsarConnectorConfig.java | 0 .../sql/presto/PulsarConnectorFactory.java | 0 .../pulsar/sql/presto/PulsarConnectorId.java | 0 .../presto/PulsarConnectorMetricsTracker.java | 0 .../sql/presto/PulsarConnectorModule.java | 0 .../sql/presto/PulsarConnectorUtils.java | 0 .../PulsarDispatchingRowDecoderFactory.java | 0 .../sql/presto/PulsarFieldValueProviders.java | 0 .../sql/presto/PulsarHandleResolver.java | 0 .../sql/presto/PulsarInternalColumn.java | 0 .../pulsar/sql/presto/PulsarMetadata.java | 0 .../pulsar/sql/presto/PulsarPlugin.java | 0 .../pulsar/sql/presto/PulsarRecordCursor.java | 0 .../pulsar/sql/presto/PulsarRecordSet.java | 0 .../sql/presto/PulsarRecordSetProvider.java | 0 .../pulsar/sql/presto/PulsarRowDecoder.java | 0 .../sql/presto/PulsarRowDecoderFactory.java | 0 .../apache/pulsar/sql/presto/PulsarSplit.java | 0 .../pulsar/sql/presto/PulsarSplitManager.java | 0 .../presto/PulsarSqlSchemaInfoProvider.java | 0 .../pulsar/sql/presto/PulsarTableHandle.java | 0 .../sql/presto/PulsarTableLayoutHandle.java | 0 .../sql/presto/PulsarTopicDescription.java | 0 .../sql/presto/PulsarTransactionHandle.java | 0 .../decoder/avro/PulsarAvroColumnDecoder.java | 0 .../decoder/avro/PulsarAvroRowDecoder.java | 0 .../avro/PulsarAvroRowDecoderFactory.java | 0 .../sql/presto/decoder/avro/package-info.java | 0 .../decoder/json/PulsarJsonFieldDecoder.java | 0 .../decoder/json/PulsarJsonRowDecoder.java | 0 .../json/PulsarJsonRowDecoderFactory.java | 0 .../sql/presto/decoder/json/package-info.java | 0 .../primitive/PulsarPrimitiveRowDecoder.java | 0 .../PulsarPrimitiveRowDecoderFactory.java | 0 .../decoder/primitive/package-info.java | 0 .../PulsarProtobufNativeColumnDecoder.java | 0 .../PulsarProtobufNativeRowDecoder.java | 0 ...PulsarProtobufNativeRowDecoderFactory.java | 0 .../decoder/protobufnative/package-info.java | 0 .../pulsar/sql/presto/package-info.java | 0 .../sql/presto/util/CacheSizeAllocator.java | 0 .../util/NoStrictCacheSizeAllocator.java | 0 .../presto/util/NullCacheSizeAllocator.java | 0 .../pulsar/sql/presto/util/package-info.java | 0 .../META-INF/services/io.trino.spi.Plugin | 0 .../sql/presto/TestCacheSizeAllocator.java | 0 .../TestNoStrictCacheSizeAllocator.java | 0 .../pulsar/sql/presto/TestPulsarAuth.java | 0 .../sql/presto/TestPulsarConnector.java | 0 .../sql/presto/TestPulsarConnectorConfig.java | 0 .../pulsar/sql/presto/TestPulsarMetadata.java | 0 .../sql/presto/TestPulsarRecordCursor.java | 0 .../sql/presto/TestPulsarSplitManager.java | 0 .../sql/presto/TestReadChunkedMessages.java | 0 .../presto/decoder/AbstractDecoderTester.java | 0 .../presto/decoder/DecoderTestMessage.java | 0 .../sql/presto/decoder/DecoderTestUtil.java | 0 .../decoder/avro/AvroDecoderTestUtil.java | 0 .../presto/decoder/avro/TestAvroDecoder.java | 0 .../decoder/json/JsonDecoderTestUtil.java | 0 .../presto/decoder/json/TestJsonDecoder.java | 0 .../primitive/PrimitiveDecoderTestUtil.java | 0 .../primitive/TestPrimitiveDecoder.java | 0 .../ProtobufNativeDecoderTestUtil.java | 0 .../decoder/protobufnative/TestMsg.java | 0 .../decoder/protobufnative/TestMsg.proto | 0 .../TestProtobufNativeDecoder.java | 0 {pulsar-sql/src => src}/checkstyle.xml | 0 {pulsar-sql/src => src}/license-header.txt | 0 {pulsar-sql/src => src}/suppressions.xml | 0 89 files changed, 6 insertions(+), 23 deletions(-) rename pulsar-sql/pom.xml => pom.xml (89%) rename {pulsar-sql/presto-distribution => presto-distribution}/LICENSE (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/pom.xml (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/assembly/assembly.xml (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/java/org/openjdk/jol/info/ClassLayout.java (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/java/org/openjdk/jol/info/package-info.java (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/resources/conf/catalog/pulsar.properties (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/resources/conf/config.properties (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/resources/conf/jvm.config (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/resources/conf/log.properties (100%) rename {pulsar-sql/presto-distribution => presto-distribution}/src/main/resources/launcher.properties (100%) rename {pulsar-sql/presto-pulsar-plugin => presto-pulsar-plugin}/pom.xml (100%) rename {pulsar-sql/presto-pulsar-plugin => presto-pulsar-plugin}/src/assembly/assembly.xml (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/pom.xml (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarAuth.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarColumnHandle.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarColumnMetadata.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnector.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorCache.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorConfig.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorId.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorMetricsTracker.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorModule.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorUtils.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarDispatchingRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarFieldValueProviders.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarHandleResolver.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarInternalColumn.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarMetadata.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarPlugin.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordSet.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordSetProvider.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarRowDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarSplit.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarSqlSchemaInfoProvider.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarTableHandle.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarTableLayoutHandle.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarTopicDescription.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/PulsarTransactionHandle.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/avro/PulsarAvroColumnDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/avro/PulsarAvroRowDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/avro/PulsarAvroRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/avro/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/json/PulsarJsonFieldDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/json/PulsarJsonRowDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/json/PulsarJsonRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/json/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/primitive/PulsarPrimitiveRowDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/primitive/PulsarPrimitiveRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/primitive/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/protobufnative/PulsarProtobufNativeColumnDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/protobufnative/PulsarProtobufNativeRowDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/protobufnative/PulsarProtobufNativeRowDecoderFactory.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/decoder/protobufnative/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/util/CacheSizeAllocator.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/util/NoStrictCacheSizeAllocator.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/util/NullCacheSizeAllocator.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/java/org/apache/pulsar/sql/presto/util/package-info.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/main/resources/META-INF/services/io.trino.spi.Plugin (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestCacheSizeAllocator.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestNoStrictCacheSizeAllocator.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarAuth.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnector.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarConnectorConfig.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarMetadata.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarRecordCursor.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestPulsarSplitManager.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/TestReadChunkedMessages.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/AbstractDecoderTester.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/DecoderTestMessage.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/DecoderTestUtil.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/avro/AvroDecoderTestUtil.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/avro/TestAvroDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/json/JsonDecoderTestUtil.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/json/TestJsonDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/primitive/PrimitiveDecoderTestUtil.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/primitive/TestPrimitiveDecoder.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/protobufnative/ProtobufNativeDecoderTestUtil.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/protobufnative/TestMsg.java (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/protobufnative/TestMsg.proto (100%) rename {pulsar-sql/presto-pulsar => presto-pulsar}/src/test/java/org/apache/pulsar/sql/presto/decoder/protobufnative/TestProtobufNativeDecoder.java (100%) rename {pulsar-sql/src => src}/checkstyle.xml (100%) rename {pulsar-sql/src => src}/license-header.txt (100%) rename {pulsar-sql/src => src}/suppressions.xml (100%) diff --git a/pulsar-sql/pom.xml b/pom.xml similarity index 89% rename from pulsar-sql/pom.xml rename to pom.xml index 6e76c5b..5a52d27 100644 --- a/pulsar-sql/pom.xml +++ b/pom.xml @@ -149,30 +149,13 @@ + + presto-pulsar + presto-pulsar-plugin + presto-distribution + + - - main - - - disableSqlMainProfile - - !true - - - - presto-pulsar - presto-pulsar-plugin - presto-distribution - - - - pulsar-sql-tests - - presto-pulsar - presto-pulsar-plugin - presto-distribution - -