Skip to content

Commit

Permalink
Change the cluster api management method. pinpoint-apm#2262
Browse files Browse the repository at this point in the history
Change the cluster api management method.
  • Loading branch information
koo-taejin committed Dec 14, 2016
1 parent 7e3f203 commit f8c6323
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 21 deletions.
2 changes: 0 additions & 2 deletions collector/src/main/resources/applicationContext-collector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@

<!-- Serializer Factory Beans -->
<bean id="commandHeaderTBaseSerializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseSerializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<bean id="commandHeaderTBaseDeserializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseDeserializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<!-- Agent Event/Lifecycle related Beans -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,15 @@

package com.navercorp.pinpoint.profiler.receiver;

import com.navercorp.pinpoint.common.Version;
import com.navercorp.pinpoint.thrift.io.*;
import com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseDeserializerFactory;
import com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseSerializerFactory;

/**
* @Author Taejin Koo
*/
public class CommandSerializer {

public static final CommandHeaderTBaseSerializerFactory SERIALIZER_FACTORY;
public static final CommandHeaderTBaseDeserializerFactory DESERIALIZER_FACTORY;

static {
SERIALIZER_FACTORY = new CommandHeaderTBaseSerializerFactory(Version.VERSION);
DESERIALIZER_FACTORY = new CommandHeaderTBaseDeserializerFactory(Version.VERSION);
}
public static final CommandHeaderTBaseSerializerFactory SERIALIZER_FACTORY = new CommandHeaderTBaseSerializerFactory();
public static final CommandHeaderTBaseDeserializerFactory DESERIALIZER_FACTORY = new CommandHeaderTBaseDeserializerFactory();

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocolFactory;

import java.util.Arrays;

/**
* @author koo.taejin
*/
public final class CommandHeaderTBaseDeserializerFactory implements DeserializerFactory<HeaderTBaseDeserializer> {

private final DeserializerFactory<HeaderTBaseDeserializer> factory;

public CommandHeaderTBaseDeserializerFactory(String version) {
TBaseLocator commandTbaseLocator = new TCommandRegistry(TCommandTypeVersion.getVersion(version));
public CommandHeaderTBaseDeserializerFactory() {
TBaseLocator commandTbaseLocator = commandTbaseLocator = new TCommandRegistry(Arrays.asList(TCommandType.values()));

TProtocolFactory protocolFactory = new TCompactProtocol.Factory();
HeaderTBaseDeserializerFactory deserializerFactory = new HeaderTBaseDeserializerFactory(protocolFactory, commandTbaseLocator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocolFactory;

import java.util.Arrays;

/**
* @author koo.taejin
*/
Expand All @@ -28,12 +30,12 @@ public final class CommandHeaderTBaseSerializerFactory implements SerializerFact

private final SerializerFactory<HeaderTBaseSerializer> factory;

public CommandHeaderTBaseSerializerFactory(String version) {
this(version, DEFAULT_SERIALIZER_MAX_SIZE);
public CommandHeaderTBaseSerializerFactory() {
this(DEFAULT_SERIALIZER_MAX_SIZE);
}

public CommandHeaderTBaseSerializerFactory(String version, int outputStreamSize) {
TBaseLocator commandTbaseLocator = new TCommandRegistry(TCommandTypeVersion.getVersion(version));
public CommandHeaderTBaseSerializerFactory(int outputStreamSize) {
TBaseLocator commandTbaseLocator = new TCommandRegistry(Arrays.asList(TCommandType.values()));

TProtocolFactory protocolFactory = new TCompactProtocol.Factory();
HeaderTBaseSerializerFactory serializerFactory = new HeaderTBaseSerializerFactory(true, outputStreamSize, protocolFactory, commandTbaseLocator);
Expand Down
2 changes: 0 additions & 2 deletions web/src/main/resources/applicationContext-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@
</bean>

<bean id="commandHeaderTBaseSerializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseSerializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<bean id="commandHeaderTBaseDeserializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseDeserializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<bean id="clusterConnectionManager" class="com.navercorp.pinpoint.web.cluster.connection.ClusterConnectionManager">
Expand Down
2 changes: 0 additions & 2 deletions web/src/test/resources/applicationContext-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@
<bean id="config" class="com.navercorp.pinpoint.web.config.WebConfig"/>

<bean id="commandHeaderTBaseSerializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseSerializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<bean id="commandHeaderTBaseDeserializerFactory" class="com.navercorp.pinpoint.thrift.io.CommandHeaderTBaseDeserializerFactory">
<constructor-arg value="#{T(com.navercorp.pinpoint.common.Version).VERSION}" />
</bean>

<bean id="pinpointSocketManager" class="com.navercorp.pinpoint.web.server.PinpointSocketManager">
Expand Down

0 comments on commit f8c6323

Please sign in to comment.