下面列出了怎么用org.apache.http.annotation.Experimental的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Bulk update API for all types, changes detected in the type definitions would be persisted
* @param typesDef A composite object that captures all type definition changes
* @return A composite object with lists of type definitions that were updated
* @throws Exception
* @HTTP 200 On successful update of requested type definitions
* @HTTP 400 On validation failure for any type definitions
*/
@PUT
@Path("/typedefs")
@Experimental
public AtlasTypesDef updateAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "TypesREST.updateAtlasTypeDefs(" +
AtlasTypeUtil.toDebugString(typesDef) + ")");
}
return typeDefStore.updateTypesDef(typesDef);
} finally {
AtlasPerfTracer.log(perf);
}
}
/**
* Bulk delete API for all types
* @param typesDef A composite object that captures all types to be deleted
* @throws Exception
* @HTTP 204 On successful deletion of the requested type definitions
* @HTTP 400 On validation failure for any type definitions
*/
@DELETE
@Path("/typedefs")
@Experimental
public void deleteAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "TypesREST.deleteAtlasTypeDefs(" +
AtlasTypeUtil.toDebugString(typesDef) + ")");
}
typeDefStore.deleteTypesDef(typesDef);
} finally {
AtlasPerfTracer.log(perf);
}
}
/** This method is currently experimental.
*
* @return a Collection of the names that a specific core object is mapped to, there are more than one.
*/
@Experimental
List<String> getNamesForCore(SolrCore core) {
List<String> lst = new ArrayList<>();
synchronized (modifyLock) {
for (Map.Entry<String, SolrCore> entry : cores.entrySet()) {
if (core == entry.getValue()) {
lst.add(entry.getKey());
}
}
if (getTransientCacheHandler() != null) {
lst.addAll(getTransientCacheHandler().getNamesForCore(core));
}
}
return lst;
}
/**
* Bulk update API for all types, changes detected in the type definitions would be persisted
* @param typesDef A composite object that captures all type definition changes
* @return A composite object with lists of type definitions that were updated
* @throws Exception
* @HTTP 200 On successful update of requested type definitions
* @HTTP 400 On validation failure for any type definitions
*/
@PUT
@Path("/typedefs")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@Experimental
public AtlasTypesDef updateAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "TypesREST.updateAtlasTypeDefs(" +
AtlasTypeUtil.toDebugString(typesDef) + ")");
}
return typeDefStore.updateTypesDef(typesDef);
} finally {
AtlasPerfTracer.log(perf);
}
}
/**
* Bulk delete API for all types
* @param typesDef A composite object that captures all types to be deleted
* @throws Exception
* @HTTP 204 On successful deletion of the requested type definitions
* @HTTP 400 On validation failure for any type definitions
*/
@DELETE
@Path("/typedefs")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@Experimental
public void deleteAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "TypesREST.deleteAtlasTypeDefs(" +
AtlasTypeUtil.toDebugString(typesDef) + ")");
}
typeDefStore.deleteTypesDef(typesDef);
} finally {
AtlasPerfTracer.log(perf);
}
}
@Experimental
public List<String> getNamesForCore(SolrCore core) {
return Collections.emptyList();
}
/**
* Use this to tag the user using phonenumber
*
* @param phoneRegex Regular expression for phone number
*/
@Experimental
public void tagPhoneNumbers(String phoneRegex){
this.phoneRegex = phoneRegex;
}