public class RestAPICaller extends java.lang.Object implements ServiceCaller
ServiceCaller
that communicates with the seeds through REST calls.EmbeddedAPICaller
Constructor and Description |
---|
RestAPICaller(LightningClientConfig config,
com.ebay.lightning.core.utils.UrlUtils urlUtils) |
Modifier and Type | Method and Description |
---|---|
com.ebay.lightning.core.store.LightningRequestReport |
getAuditJsonReport(java.lang.String sessionId,
java.lang.String serviceHostIp)
Get the audit report for the request id in JSON format.
|
com.ebay.lightning.core.store.LightningRequestReport |
getAuditReport(java.lang.String sessionId,
java.lang.String serviceHostIp)
Get the audit report for the request id in compressed format.
|
java.util.List<com.ebay.lightning.core.store.LightningRequestReport> |
getAuditSummary(java.lang.String serviceHostIp,
java.lang.String sessionId)
Get the audit summary in compressed format.
|
com.ebay.lightning.core.beans.SystemStatus |
getLightningStats(java.lang.String serviceHostIp)
Get the system statistics of the seed
|
com.ebay.lightning.core.config.SystemConfig |
getSystemConfig(java.lang.String serviceHostIp)
Get the configuration of the seed
|
com.ebay.lightning.core.beans.LightningResponse |
pollResults(java.lang.String sessionId,
java.lang.String serviceHostIp,
boolean pollDeltaOnly)
Get the result for the session id.
|
com.ebay.lightning.core.beans.ReservationReceipt |
reserve(int forLoad,
java.lang.String serviceHostIp)
Attempts to reserve task execution bandwidth on the seed
|
boolean |
submit(com.ebay.lightning.core.beans.LightningRequest request,
java.lang.String serviceHostIp)
Submits the request to the specific seed.
|
com.ebay.lightning.core.config.SystemConfig |
updateSystemConfig(java.lang.String serviceHostIp,
com.ebay.lightning.core.config.SystemConfig sysConfig)
Update the configuration of the seed
|
public RestAPICaller(LightningClientConfig config, com.ebay.lightning.core.utils.UrlUtils urlUtils)
public com.ebay.lightning.core.beans.ReservationReceipt reserve(int forLoad, java.lang.String serviceHostIp)
ServiceCaller
reserve
in interface ServiceCaller
forLoad
- load size of the requestserviceHostIp
- the seedpublic boolean submit(com.ebay.lightning.core.beans.LightningRequest request, java.lang.String serviceHostIp)
ServiceCaller
submit
in interface ServiceCaller
request
- the request with the reservation receipt and task listserviceHostIp
- the seed that executes the requesttrue
if the submit operation is successfulpublic com.ebay.lightning.core.beans.LightningResponse pollResults(java.lang.String sessionId, java.lang.String serviceHostIp, boolean pollDeltaOnly)
ServiceCaller
pollResults
in interface ServiceCaller
sessionId
- the session id submitted through ServiceCaller.submit(LightningRequest, String)
method or
returned by the ServiceCaller.reserve(int, String)
methodserviceHostIp
- the seedpollDeltaOnly
- get the complete or only the deltapublic com.ebay.lightning.core.store.LightningRequestReport getAuditReport(java.lang.String sessionId, java.lang.String serviceHostIp)
ServiceCaller
getAuditReport
in interface ServiceCaller
sessionId
- the session id submitted through ServiceCaller.submit(LightningRequest, String)
method or
returned by the ServiceCaller.reserve(int, String)
methodserviceHostIp
- the seedpublic com.ebay.lightning.core.store.LightningRequestReport getAuditJsonReport(java.lang.String sessionId, java.lang.String serviceHostIp)
ServiceCaller
getAuditJsonReport
in interface ServiceCaller
sessionId
- the session id submitted through ServiceCaller.submit(LightningRequest, String)
method or
returned by the ServiceCaller.reserve(int, String)
methodserviceHostIp
- the seedpublic java.util.List<com.ebay.lightning.core.store.LightningRequestReport> getAuditSummary(java.lang.String serviceHostIp, java.lang.String sessionId)
ServiceCaller
getAuditSummary
in interface ServiceCaller
serviceHostIp
- the seedsessionId
- the session id submitted through ServiceCaller.submit(LightningRequest, String)
method or
returned by the ServiceCaller.reserve(int, String)
methodpublic com.ebay.lightning.core.config.SystemConfig updateSystemConfig(java.lang.String serviceHostIp, com.ebay.lightning.core.config.SystemConfig sysConfig)
ServiceCaller
updateSystemConfig
in interface ServiceCaller
serviceHostIp
- the seedsysConfig
- the configuration changes to be appliedSystemConfig
after updatingpublic com.ebay.lightning.core.config.SystemConfig getSystemConfig(java.lang.String serviceHostIp)
ServiceCaller
getSystemConfig
in interface ServiceCaller
serviceHostIp
- the seedSystemConfig
that includes the seed capacity, retention policy etcpublic com.ebay.lightning.core.beans.SystemStatus getLightningStats(java.lang.String serviceHostIp)
ServiceCaller
getLightningStats
in interface ServiceCaller
serviceHostIp
- the seedSystemStatus
that include information related to load, memory, CPU etc