本文整理了Java中io.yawp.repository.Yawp.yawp()
方法的一些代码示例,展示了Yawp.yawp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yawp.yawp()
方法的具体详情如下:
包路径:io.yawp.repository.Yawp
类名称:Yawp
方法名:yawp
暂无
代码示例来源:origin: feroult/yawp
public T get() {
if (object == null && json == null) {
return null;
}
if (object == null) {
object = (T) JsonUtils.from(Yawp.yawp(), json, type);
}
return object;
}
代码示例来源:origin: feroult/yawp
public IdRef<?> getSinkId() {
if (sinkId == null) {
sinkId = IdRef.parse(yawp(), sinkUri);
}
return sinkId;
}
代码示例来源:origin: feroult/yawp
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
String uri = (String) in.readObject();
IdRef<T> idRef = (IdRef<T>) parse(yawp(), uri);
this.r = idRef.r;
this.clazz = idRef.clazz;
this.model = idRef.model;
this.id = idRef.id;
this.name = idRef.name;
this.parentId = idRef.parentId;
}
代码示例来源:origin: feroult/yawp
private void init(Class<? extends Pipe> pipeClazz, String cursor) {
this.r = yawp();
this.pipeClazz = pipeClazz;
this.sourceClazz = ReflectionUtils.getFeatureEndpointClazz(pipeClazz);
this.cursor = cursor;
}
代码示例来源:origin: feroult/yawp
private List<T> readObjects(ObjectInputStream in) throws IOException, ClassNotFoundException {
List<String> jsonList = (List<String>) in.readObject();
List<T> objects = new ArrayList<>();
for (String json : jsonList) {
objects.add((T) JsonUtils.from(Yawp.yawp(), json, clazz));
}
return objects;
}
代码示例来源:origin: feroult/yawp
private void init(Class<? extends Pipe> pipeClazz, String sourceUri) {
this.r = yawp();
this.pipeClazz = pipeClazz;
this.sourceId = IdRef.parse(r, sourceUri);
}
代码示例来源:origin: feroult/yawp
public SourceMarker getSourceMarker() {
if (sourceMarker == null) {
sourceMarker = JsonUtils.from(yawp(), sourceMarkerJson, SourceMarker.class);
}
return sourceMarker;
}
代码示例来源:origin: feroult/yawp
@Override
public IdRef deserialize(ObjectReader reader, Context ctx) throws Exception {
String json = reader.valueAsString();
return IdRef.parse(yawp(), null, json);
}
}
代码示例来源:origin: feroult/yawp
protected Repository initYawp() {
String appPackage = getAppPackage();
if (appPackage != null) {
Yawp.init(appPackage);
}
return Yawp.yawp();
}
代码示例来源:origin: feroult/yawp
public WorksExecutor(Repository r, List<Work> works) {
this.r = r;
this.works = works;
this.r = yawp().namespace(ns);
this.async = r.async();
}
代码示例来源:origin: feroult/yawp
private void init(Class<? extends Pipe> pipeClazz, String sinkUri, String cursor) {
this.r = yawp();
this.pipeClazz = pipeClazz;
this.sourceClazz = ReflectionUtils.getFeatureEndpointClazz(pipeClazz);
this.sinkId = IdRef.parse(r, sinkUri);
this.cursor = cursor;
}
代码示例来源:origin: feroult/yawp
public Object getSource() {
if (source == null) {
source = JsonUtils.from(yawp(), sourceJson, ReflectionUtils.clazzForName(sourceClazzName));
}
return source;
}
代码示例来源:origin: feroult/yawp
private QueryBuilder<Work> worksQuery() {
long timestamp = System.currentTimeMillis() - ELAPSED_TIME_MILLES;
QueryBuilder<Work> q = yawp(Work.class).where("timestamp", "<=", timestamp);
if (cursor != null) {
q.setCursor(cursor);
}
q.limit(BATCH_SIZE);
return q;
}
代码示例来源:origin: feroult/yawp
public Object getSource() {
if (source == null) {
source = JsonUtils.from(yawp(), sourceJson, ReflectionUtils.getFeatureEndpointClazz(getPipeClazz()));
}
return source;
}
代码示例来源:origin: feroult/yawp
public Object getOldSource() {
if (oldSource == null) {
oldSource = JsonUtils.from(yawp(), oldSourceJson, ReflectionUtils.getFeatureEndpointClazz(getPipeClazz()));
}
return oldSource;
}
代码示例来源:origin: feroult/yawp
private void init() {
this.r = yawp().namespace(payload.getNs());
this.pipe = newPipeInstance();
this.source = payload.getSource();
}
代码示例来源:origin: feroult/yawp
private void init() {
logger.info(String.format("fork-task - pipe: %s, sinkId: %s", payload.getPipeClazz().getName(), payload.getSinkUri()));
this.r = yawp().namespace(payload.getNs());
this.pipe = newPipeInstance();
this.sinkGroupUri = payload.getSinkGroupUri();
this.indexCacheKey = createIndexCacheKey(sinkGroupUri);
this.memcache = MemcacheServiceFactory.getMemcacheService(payload.getNs());
}
代码示例来源:origin: feroult/yawp
private void init() {
this.r = yawp().namespace(ns);
this.memcache = MemcacheServiceFactory.getMemcacheService(ns);
this.indexCacheKey = CacheHelper.createIndexCacheKey(sinkGroupUri);
this.lockCacheKey = CacheHelper.createLockCacheKey(sinkGroupUri, index);
this.indexHash = CacheHelper.createIndexHash(sinkGroupUri, index);
}
代码示例来源:origin: feroult/yawp
@Before
public void setUp() {
Environment.setIfEmpty(Environment.DEFAULT_TEST_ENVIRONMENT);
yawp = Yawp.yawp();
helper = testHelperDriver(yawp);
helper.setUp();
Cache.clearAll();
}
代码示例来源:origin: feroult/yawp
@Test
public void testSimpleRepositoryAccess() {
Yawp.yawp.save(new BasicObject("xpto"));
BasicObject retrievedObject = Yawp.yawp(BasicObject.class).first();
assertEquals("xpto", retrievedObject.getStringValue());
}
内容来源于网络,如有侵权,请联系作者删除!