You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2018/04/21 21:15:43 UTC
[incubator-pulsar] branch master updated: [pulsar-connect] Add pull
source (#1622)
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 584cda2 [pulsar-connect] Add pull source (#1622)
584cda2 is described below
commit 584cda2295b171ee9f3d7063445bfec49b5333b0
Author: Boyang Jerry Peng <je...@gmail.com>
AuthorDate: Sat Apr 21 14:15:41 2018 -0700
[pulsar-connect] Add pull source (#1622)
---
.../org/apache/pulsar/connect/core/Source.java | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Source.java b/pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Source.java
new file mode 100644
index 0000000..b63a4b7
--- /dev/null
+++ b/pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Source.java
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+package org.apache.pulsar.connect.core;
+
+import java.util.Map;
+
+public interface Source<T> extends AutoCloseable {
+ /**
+ * Open connector with configuration
+ *
+ * @param config initialization config
+ * @throws Exception IO type exceptions when opening a connector
+ */
+ void open(final Map<String, String> config) throws Exception;
+
+ /**
+ * Reads the next message from source, if one exists, and returns. This call should be non-blocking.
+ * If source does not have any new messages, return null immediately.
+ * @return next message from source or null, if no new messages are available.
+ * @throws Exception
+ */
+ Message<T> read() throws Exception;
+}
--
To stop receiving notification emails like this one, please contact
sijie@apache.org.