druid-api version not required

This commit is contained in:
Himadri Singh 2013-12-10 00:05:56 +05:30
parent 32200b9b41
commit e6b915f1e7
1 changed files with 1 additions and 35 deletions

View File

@ -46,14 +46,13 @@ public class StatusResource
{ {
return new Status( return new Status(
Initialization.class.getPackage().getImplementationVersion(), Initialization.class.getPackage().getImplementationVersion(),
getVersion("/druid-api.version"),
getExtensionVersions(), getExtensionVersions(),
new Memory(Runtime.getRuntime()) new Memory(Runtime.getRuntime())
); );
} }
/** /**
* Load the extensions list and return the implementation-versions * Load the unique extensions and return their implementation-versions
* *
* @return map of extensions loaded with their respective implementation versions. * @return map of extensions loaded with their respective implementation versions.
*/ */
@ -70,46 +69,19 @@ public class StatusResource
return moduleVersions; return moduleVersions;
} }
/**
* Load properties files from the classpath and return version number
*
* @param versionFile
*
* @return version number
*/
private String getVersion(String versionFile)
{
Properties properties = new Properties();
try {
InputStream is = StatusResource.class.getResourceAsStream(versionFile);
if (is == null) {
return null;
}
properties.load(is);
}
catch (IOException e) {
// e.printStackTrace();
}
return properties.getProperty("version");
}
public static class Status public static class Status
{ {
final String serverVersion; final String serverVersion;
final String apiVersion;
final Map<String, String> extensionsVersion; final Map<String, String> extensionsVersion;
final Memory memory; final Memory memory;
public Status( public Status(
String serverVersion, String serverVersion,
String apiVersion,
Map<String, String> extensionsVersion, Map<String, String> extensionsVersion,
Memory memory Memory memory
) )
{ {
this.serverVersion = serverVersion; this.serverVersion = serverVersion;
this.apiVersion = apiVersion;
this.extensionsVersion = extensionsVersion; this.extensionsVersion = extensionsVersion;
this.memory = memory; this.memory = memory;
} }
@ -120,12 +92,6 @@ public class StatusResource
return serverVersion; return serverVersion;
} }
@JsonProperty
public String getApiVersion()
{
return apiVersion;
}
@JsonProperty @JsonProperty
public Map<String, String> getExtensionsVersion() public Map<String, String> getExtensionsVersion()
{ {