// NOTE: ImmutableMap enforces that we don't have duplicate method names
ImmutableMap.Builder<String, ThriftMethodProcessor> processorBuilder = ImmutableMap.builder();
ImmutableMultimap.Builder<String, ThriftMethodStats> statsBuilder = ImmutableMultimap.builder();
for (Object service : services) {
ThriftServiceMetadata serviceMetadata = new ThriftServiceMetadata(service.getClass(), codecManager.getCatalog());
for (ThriftMethodMetadata methodMetadata : serviceMetadata.getMethods().values()) {
ThriftMethodProcessor methodProcessor = new ThriftMethodProcessor(service, methodMetadata, codecManager);
processorBuilder.put(methodMetadata.getName(), methodProcessor);
statsBuilder.put(serviceMetadata.getName(), methodProcessor.getStats());
}
}
methods = processorBuilder.build();
serviceStats = statsBuilder.build();
}