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

[pulsar-broker] Broker extensions to allow operators of enterprise wide cluster better control and flexibility #12536

Merged
merged 18 commits into from
Dec 14, 2021

Conversation

madhavan-narayanan
Copy link
Contributor

@madhavan-narayanan madhavan-narayanan commented Oct 29, 2021

Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this

Modifications

  • Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
  • Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
  • Enhanced PulsarAdmin to give operators a control in managing super-users

Verifying this change

  • [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The wire protocol: no
  • The rest endpoints: no
  • The admin cli options: no
  • Anything that affects deployment: no

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 29, 2021
@github-actions
Copy link

@madhavan-narayanan:Thanks for providing doc info!

@madhavan-narayanan madhavan-narayanan changed the title [pulsar-broker] [pulsar-broker] Broker extensions to allow operators of enterprise wide cluster better control and flexibility Oct 29, 2021
@github-actions
Copy link

@madhavan-narayanan:Thanks for providing doc info!

@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label Oct 29, 2021
@github-actions
Copy link

@madhavan-narayanan:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Oct 29, 2021
@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Oct 29, 2021
@merlimat merlimat added this to the 2.10.0 milestone Oct 29, 2021
@github-actions
Copy link

@madhavan-narayanan:Thanks for providing doc info!

return create(ledgerEntry,null);
}

public static EntryImpl create(LedgerEntry ledgerEntry, ManagedLedgerInterceptor managedLedgerInterceptor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the 'managedLedgerInterceptor' in here seem a little strange.
IMHO, it's better put outside of create, the managedLedgerInterceptor processes the ledgerEntry and then pass the result to this create method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extended the create() to ensure that future usages of this method from other places don't miss out the interceptor.
I do agree that it will be clean to have the calling methods process the ledger entry using interceptors and pass the result.

…et is used to ensure iteration order is same as insertion order
@codelipenghui
Copy link
Contributor

@madhavan-narayanan It should be good to start with a proposal for this new feature, I noticed there are new API introduced. For starting a proposal for Pulsar, you can check https://lists.apache.org/thread/m8dr0hz7qn7rkd48bcp430lcq2q3674g

@madhavan-narayanan
Copy link
Contributor Author

@madhavan-narayanan It should be good to start with a proposal for this new feature, I noticed there are new API introduced. For starting a proposal for Pulsar, you can check https://lists.apache.org/thread/m8dr0hz7qn7rkd48bcp430lcq2q3674g

@codelipenghui , thanks for your comment. I will start a proposal as you suggested.

@@ -77,6 +77,7 @@
private int newEntriesCheckDelayInMillis = 10;
private Clock clock = Clock.systemUTC();
private ManagedLedgerInterceptor managedLedgerInterceptor;
private ManagedLedgerInterceptor managedLedgerPayloadProcessor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're using the same interface, couldn't we have a single managedLedgerInterceptor instance>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -221,7 +221,7 @@ private void asyncReadEntry0(ReadHandle lh, PositionImpl position, final ReadEnt
Iterator<LedgerEntry> iterator = ledgerEntries.iterator();
if (iterator.hasNext()) {
LedgerEntry ledgerEntry = iterator.next();
EntryImpl returnEntry = EntryImpl.create(ledgerEntry);
EntryImpl returnEntry = EntryImpl.create(ledgerEntry, ml.getConfig().getManagedLedgerPayloadProcessor());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can store the interceptor as a member variable of EntryCacheImpl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

public void consumerCreated(ServerCnx cnx,
Consumer consumer,
Map<String, String> metadata) {
for (BrokerInterceptorWithClassLoader value : interceptors.values()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was already the style of other methods here, though we should try to avoid the allocation of an iterator instance in the case where there are no interceptors. eg:

if (interceptors.isEmpty()) {
  return;
}

for (BrokerInterceptorWithClassLoader value : interceptors.values()) {
     // .... 
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 please check null or empty first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 84 to 86
CompletableFuture<Void> promise = new CompletableFuture<>();
promise.complete(null);
return promise;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CompletableFuture<Void> promise = new CompletableFuture<>();
promise.complete(null);
return promise;
return CompletableFuture.completedFuture(null);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N/A with the latest changes. This class doesn't exist anymore

@@ -307,6 +308,7 @@ public TransportCnx getCnx() {
}

private static final class MessagePublishContext implements PublishContext, Runnable {
Map<String, Object> propertyMap = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear why we need to use the property map here and we should try to avoid the allocation if it's not being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. propertyMap is created only when needed

@@ -1420,11 +1435,15 @@ protected void handleAck(CommandAck ack) {
final long consumerId = ack.getConsumerId();

if (consumerFuture != null && consumerFuture.isDone() && !consumerFuture.isCompletedExceptionally()) {
Consumer consumer = consumerFuture.getNow(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have the consumer variable here, we can also change the next line to avoid doing getNow() again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* @param extraClientHeaders
* @return
*/
PulsarAdminBuilder extraClientHeaders(String extraClientHeaders);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change should go in a separate PR since it's a bit different from the payload interceptor change.

Also, it's not clear from API perspective how the extra headers are going to be used and what is the format of that string is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N/A anymore. Removed from the changeset

if(cacheBuf != null && cacheBuf != entry.data)
entry.data = cacheBuf;
else
entry.data.retain();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking the equality of the buffer instance, the interceptor should have a well defined semantic on the expectation of the reference count of the returned buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* @param ledgerData data from ledger
* @return data after processing, if any
*/
default ByteBuf beforeCacheEntryFromLedger(ByteBuf ledgerData){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to be very explicit here (and careful :) ) on the reference-count expectations here for the buffers, to avoid memory leaks or use-after-destroyed scenarios.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. The interface is better defined and documented now

}

@Override
public boolean isSuperUser(PulsarService pulsarService, String appId, String originalPrincipal){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be more suitable to custom authorization provider, where there is already the isSuperUser() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from the changeset

@madhavan-narayanan
Copy link
Contributor Author

@madhavan-narayanan It should be good to start with a proposal for this new feature, I noticed there are new API introduced. For starting a proposal for Pulsar, you can check https://lists.apache.org/thread/m8dr0hz7qn7rkd48bcp430lcq2q3674g

@codelipenghui , thanks for your comment. I will start a proposal as you suggested.

Created a feature request #12752

@codelipenghui
Copy link
Contributor

@madhavan-narayanan Thanks.

@codelipenghui codelipenghui merged commit 03bbc8e into apache:master Dec 14, 2021
@madhavan-narayanan
Copy link
Contributor Author

@hangc0276 , @codelipenghui , @merlimat , @Jason918
Thanks a lot for your patient review and guidance. This PR will greatly help us as Pulsar cluster operators to move with increased velocity and accelerate internal adoption of Pulsar.

madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Dec 17, 2021
…de cluster better control and flexibility (apache#12536)

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Dec 20, 2021
…de cluster better control and flexibility (apache#12536)

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Dec 21, 2021
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Jan 15, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Jan 18, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Jan 18, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
madhavan-narayanan added a commit to madhavan-narayanan/pulsar that referenced this pull request Jan 31, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Mar 3, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Mar 16, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Mar 21, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Apr 7, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Apr 7, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
kishorepulla pushed a commit to kishorepulla/pulsar that referenced this pull request Apr 10, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
kishorepulla pushed a commit to kishorepulla/pulsar that referenced this pull request Apr 21, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
yugadeepaIntuit pushed a commit to yugadeepaIntuit/pulsar that referenced this pull request Oct 10, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
yugadeepaIntuit pushed a commit to yugadeepaIntuit/pulsar that referenced this pull request Oct 20, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
sajithsebastian pushed a commit to sajithsebastian/pulsar that referenced this pull request Oct 30, 2022
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
congbobo184 pushed a commit that referenced this pull request Nov 17, 2022
…de cluster better control and flexibility (#12536)

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *

(cherry picked from commit 03bbc8e)
@congbobo184 congbobo184 added cherry-picked/branch-2.9 Archived: 2.9 is end of life release/2.9.4 labels Nov 17, 2022
congbobo184 pushed a commit that referenced this pull request Nov 30, 2022
…de cluster better control and flexibility (#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *

(cherry picked from commit 03bbc8e)
@Anonymitaet
Copy link
Member

Hi @madhavan-narayanan, thanks for your great contribution!

I see you marked this PR with the doc-required label, but the doc has not been added yet.

To figure out what content we should add, we (+@hangc0276) have gone through the PR changes and figured out the general idea (it adds some inceptors to brokers to better process messages), but we do not know the details.

Since you're the author, can you please add docs or provide technical inputs?

====================

To help you quickly get started, here are some thoughts on doc inputs:

  1. Highly-level structure

    How about adding a new topic in Development > Plugin > Interceptor and putting the docs there?

image

  1. Specific topics

    To help devs use this new feature smoothly, consider taking the following doc elements into consideration:

    • Who (Developers)
    • What (What is this? What features does it provide? → Overview)
    • Why (What are the benefits of using this feature? → Use Case)
    • When (When to use it? Any considerations or limitations?)
    • How (How to use it? → Tutorials (e.g., Get Started) / How-to Guides / Interface Reference doc)

    You can take Pulsar Admin API doc as a reference and template. Thank you!

====================

cc @D-2-Ed

SumangalaRao pushed a commit to SumangalaRao/pulsar that referenced this pull request Aug 23, 2023
…de cluster better control and flexibility (apache#12536)

### Motivation

Operators of enterprise Pulsar cluster(s) would need the flexibility and control to intercept broker events (including ledger writes/reads) for template validations, observability and access control. This changeset contains enhancements to existing interceptor mechanism to support this 

### Modifications

- Enhanced org.apache.pulsar.broker.intercept.BrokerInterceptor interface to include additional events for tracing
- Created a new interface org.apache.pulsar.common.intercept.MessagePayloadProcessor to allow interception of ledger write/read operations
- Enhanced PulsarAdmin to give operators a control in managing super-users

### Verifying this change

- [x ] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:
  - *Added new test cases to MangedLedgerInterceptorImplTest.java and BrokerInterceptorTest.java *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-required Your PR changes impact docs and you will update later. release/2.9.4 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants