Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide SPI for modules so there might be developed independently #4

Open
smiklosovic opened this issue Nov 9, 2020 · 6 comments
Open
Assignees
Labels

Comments

@smiklosovic
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

I would like to be able to implement modules and use them without actually merging them into the code base.

Describe the solution you'd like

There needs to be a SPI provided / implemented so mere placing of an implementation to class path will result in an operation module being instantiated and registered upon Icarus starting.

@smiklosovic smiklosovic self-assigned this Nov 9, 2020
@smiklosovic smiklosovic changed the title [FEATURE] Provide SPI for modules so there might be developed independently Nov 9, 2020
@2ban
Copy link

2ban commented Nov 29, 2021

Hi, @smiklosovic , any news on this feature? I wanted to list backups via Icarus operations but haven't found one, so I thought implementing my own, but don't really want to change the source code

@smiklosovic
Copy link
Collaborator Author

Hi, listing of backups is already there. (1), (2), (3). I am not sure if this module is in Icarus but it should be. I have not tested listing via Icarus. Feel free to test it out and let me know if it works.

(1) https://github.com/instaclustr/esop#listing-of-backups
(2) https://github.com/instaclustr/esop/blob/master/src/main/java/com/instaclustr/esop/impl/list/ListOperation.java
(3) https://github.com/instaclustr/esop/blob/master/src/main/java/com/instaclustr/esop/impl/list/ListModule.java

@2ban
Copy link

2ban commented Nov 30, 2021

Yeah, I didn't check for this module in Esop, but it looks like it's not added to Icarus, at least I cannot find it in here https://github.com/instaclustr/icarus/blob/master/src/main/java/com/instaclustr/icarus/Icarus.java

And trying to call this operation to Icarus fails:
Request:

curl -X 'POST' \
  'http://http://<icarus>/operations' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '	{
    "type": "list",
    "storageLocation": "file:///tmp/cassandra/dc2/bf652c07-8aff-4cd0-a166-2212f08b0140"
}'

Response:

can't parse JSON.  Raw result:

Could not resolve type id 'list' as a subtype of `com.instaclustr.operations.OperationRequest`: type ids are not statically known
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 2, column: 13]

@smiklosovic
Copy link
Collaborator Author

@2ban could you add it there, test it and create a pull request, please?

@smiklosovic
Copy link
Collaborator Author

@2ban
Copy link

2ban commented Dec 9, 2021

@smiklosovic great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants