Skip to content

Comments

add parameter ignoreReadMethod in ObjectPropertyAccessor#313

Merged
lukaszlenart merged 2 commits intoorphan-oss:mainfrom
qchole:property-accessor
Dec 27, 2024
Merged

add parameter ignoreReadMethod in ObjectPropertyAccessor#313
lukaszlenart merged 2 commits intoorphan-oss:mainfrom
qchole:property-accessor

Conversation

@qchole
Copy link
Contributor

@qchole qchole commented Nov 27, 2024

current implementation of getting property using ObjectPropertyAccessor will firstly try to find get method of target property,
if no get method found then try to find read method. If read method exist returns the return value of the read method。Sometimes read method does not directly returns the value of property. For example the class org.apache.kafka.clients.consumer.internals.Fetcher , it has a property completedFetches, and a method hasCompletedFetches which will be recognized as a read method of the property completedFetches, it returns a boolean value instead of the actural value of completedFetches. But what I need is to get the elements of ConcurrentLinkedQueue. So I think we should offer a parameter to ignore detecting read method in this case.

public class Fetcher<K, V> implements Closeable {
   
    private final int maxPollRecords;
    private final boolean checkCrcs;
    private final String clientRackId;
    private final ConsumerMetadata metadata;
    private final FetchManagerMetrics sensors;
    private final SubscriptionState subscriptions;
    private final ConcurrentLinkedQueue<CompletedFetch> completedFetches;
   
    private final ApiVersions apiVersions;

    private PartitionRecords nextInLineRecords = null;

  
    public boolean hasCompletedFetches() {
        return !completedFetches.isEmpty();
    }
}

@qchole qchole changed the title add parameter ignoreRead in ObjectPropertyAccessor add parameter ignoreReadMethod in ObjectPropertyAccessor Nov 27, 2024
@lukaszlenart lukaszlenart merged commit 020f2b1 into orphan-oss:main Dec 27, 2024
2 of 3 checks passed
MiViK7

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants