Fix Json Serde (#5370)

This commit is contained in:
Jihoon Son 2018-02-08 13:13:52 -08:00 committed by Gian Merlino
parent e64ffb10c2
commit 0105cdbc19
2 changed files with 20 additions and 0 deletions

View File

@ -57,6 +57,12 @@ public class ClientCompactQueryTuningConfig
this.publishTimeout = publishTimeout == null ? DEFAULT_PUBLISH_TIMEOUT : publishTimeout;
}
@JsonProperty
public String getType()
{
return "index";
}
@JsonProperty
public int getMaxRowsInMemory()
{

View File

@ -27,6 +27,7 @@ import io.druid.audit.AuditInfo;
import io.druid.audit.AuditManager;
import io.druid.common.config.ConfigManager.SetResult;
import io.druid.common.config.JacksonConfigManager;
import io.druid.java.util.common.StringUtils;
import io.druid.server.coordinator.CoordinatorCompactionConfig;
import io.druid.server.coordinator.DataSourceCompactionConfig;
import io.druid.server.http.security.ConfigResourceFilter;
@ -121,6 +122,19 @@ public class CoordinatorCompactionConfigsResource
@Context HttpServletRequest req
)
{
if (!dataSource.equals(newConfig.getDataSource())) {
return Response
.status(Response.Status.BAD_REQUEST)
.entity(
StringUtils.format(
"dataSource[%s] in config is different from the requested one[%s]",
newConfig.getDataSource(),
dataSource
)
)
.build();
}
CoordinatorCompactionConfig current = manager.watch(
CoordinatorCompactionConfig.CONFIG_KEY,
CoordinatorCompactionConfig.class