Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE #4403] Fix the SPI extension admin-api loading of storage-plug…
…ins (#4404) * fix: remove knative circulate dependency * feat: realize knative admin-api * feat: realize mongodb admin-api * feat: realize pulsar admin-api * feat: realize pravega admin-api * fix: deliver a config to client instead of null * chore: revert startup plugin config
- Loading branch information
Showing
14 changed files
with
636 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...torage-knative/src/main/java/org/apache/eventmesh/storage/knative/admin/KnativeAdmin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* 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.eventmesh.storage.knative.admin; | ||
|
||
import org.apache.eventmesh.api.admin.AbstractAdmin; | ||
import org.apache.eventmesh.api.admin.TopicProperties; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
import io.cloudevents.CloudEvent; | ||
|
||
public class KnativeAdmin extends AbstractAdmin { | ||
|
||
public KnativeAdmin() { | ||
super(new AtomicBoolean(false)); | ||
} | ||
|
||
@Override | ||
public List<TopicProperties> getTopic() { | ||
// TODO implement admin functions | ||
return new ArrayList<>(); | ||
} | ||
|
||
@Override | ||
public void createTopic(String topicName) { | ||
} | ||
|
||
@Override | ||
public void deleteTopic(String topicName) { | ||
} | ||
|
||
@Override | ||
public void publish(CloudEvent cloudEvent) throws Exception { | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
...knative/src/main/java/org/apache/eventmesh/storage/knative/admin/KnativeAdminAdaptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* 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.eventmesh.storage.knative.admin; | ||
|
||
import org.apache.eventmesh.api.admin.Admin; | ||
import org.apache.eventmesh.api.admin.TopicProperties; | ||
|
||
import java.util.List; | ||
import java.util.Properties; | ||
|
||
import io.cloudevents.CloudEvent; | ||
|
||
public class KnativeAdminAdaptor implements Admin { | ||
|
||
private final KnativeAdmin admin; | ||
|
||
public KnativeAdminAdaptor() { | ||
admin = new KnativeAdmin(); | ||
} | ||
|
||
@Override | ||
public boolean isStarted() { | ||
return admin.isStarted(); | ||
} | ||
|
||
@Override | ||
public boolean isClosed() { | ||
return admin.isClosed(); | ||
} | ||
|
||
@Override | ||
public void start() { | ||
admin.start(); | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
admin.shutdown(); | ||
} | ||
|
||
@Override | ||
public void init(Properties properties) throws Exception { | ||
admin.init(properties); | ||
} | ||
|
||
@Override | ||
public List<TopicProperties> getTopic() throws Exception { | ||
return admin.getTopic(); | ||
} | ||
|
||
@Override | ||
public void createTopic(String topicName) { | ||
admin.createTopic(topicName); | ||
} | ||
|
||
@Override | ||
public void deleteTopic(String topicName) { | ||
admin.deleteTopic(topicName); | ||
} | ||
|
||
@Override | ||
public List<CloudEvent> getEvent(String topicName, int offset, int length) throws Exception { | ||
return admin.getEvent(topicName, offset, length); | ||
} | ||
|
||
@Override | ||
public void publish(CloudEvent cloudEvent) throws Exception { | ||
admin.publish(cloudEvent); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...torage-knative/src/main/resources/META-INF/eventmesh/org.apache.eventmesh.api.admin.Admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
knative=org.apache.eventmesh.storage.knative.admin.KnativeAdminAdaptor |
56 changes: 56 additions & 0 deletions
56
...torage-mongodb/src/main/java/org/apache/eventmesh/storage/mongodb/admin/MongodbAdmin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* 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.eventmesh.storage.mongodb.admin; | ||
|
||
import org.apache.eventmesh.api.admin.AbstractAdmin; | ||
import org.apache.eventmesh.api.admin.TopicProperties; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
import io.cloudevents.CloudEvent; | ||
|
||
public class MongodbAdmin extends AbstractAdmin { | ||
|
||
public MongodbAdmin() { | ||
super(new AtomicBoolean(false)); | ||
} | ||
|
||
@Override | ||
public List<TopicProperties> getTopic() { | ||
// TODO implement admin functions | ||
return new ArrayList<>(); | ||
} | ||
|
||
@Override | ||
public void createTopic(String topicName) { | ||
} | ||
|
||
@Override | ||
public void deleteTopic(String topicName) { | ||
} | ||
|
||
@Override | ||
public void publish(CloudEvent cloudEvent) throws Exception { | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
...mongodb/src/main/java/org/apache/eventmesh/storage/mongodb/admin/MongodbAdminAdaptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* 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.eventmesh.storage.mongodb.admin; | ||
|
||
import org.apache.eventmesh.api.admin.Admin; | ||
import org.apache.eventmesh.api.admin.TopicProperties; | ||
|
||
import java.util.List; | ||
import java.util.Properties; | ||
|
||
import io.cloudevents.CloudEvent; | ||
|
||
public class MongodbAdminAdaptor implements Admin { | ||
|
||
private final MongodbAdmin admin; | ||
|
||
public MongodbAdminAdaptor() { | ||
admin = new MongodbAdmin(); | ||
} | ||
|
||
@Override | ||
public boolean isStarted() { | ||
return admin.isStarted(); | ||
} | ||
|
||
@Override | ||
public boolean isClosed() { | ||
return admin.isClosed(); | ||
} | ||
|
||
@Override | ||
public void start() { | ||
admin.start(); | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
admin.shutdown(); | ||
} | ||
|
||
@Override | ||
public void init(Properties properties) throws Exception { | ||
admin.init(properties); | ||
} | ||
|
||
@Override | ||
public List<TopicProperties> getTopic() throws Exception { | ||
return admin.getTopic(); | ||
} | ||
|
||
@Override | ||
public void createTopic(String topicName) { | ||
admin.createTopic(topicName); | ||
} | ||
|
||
@Override | ||
public void deleteTopic(String topicName) { | ||
admin.deleteTopic(topicName); | ||
} | ||
|
||
@Override | ||
public List<CloudEvent> getEvent(String topicName, int offset, int length) throws Exception { | ||
return admin.getEvent(topicName, offset, length); | ||
} | ||
|
||
@Override | ||
public void publish(CloudEvent cloudEvent) throws Exception { | ||
admin.publish(cloudEvent); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...torage-mongodb/src/main/resources/META-INF/eventmesh/org.apache.eventmesh.api.admin.Admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
mongodb=org.apache.eventmesh.storage.mongodb.admin.MongodbAdminAdaptor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.