@Override public String getPath() { return instanceMeta.getPath(); } }
private File createIndexFile(String bagName, String indexName, boolean multi) throws JasDBStorageException { StringBuilder indexFileNameBuilder = new StringBuilder(); String extension = multi ? INDEX_EXTENSION_MULTI : INDEX_EXTENSION; indexFileNameBuilder.append(bagName).append(BAG_INDEX_NAME_SPLITTER); indexFileNameBuilder.append(indexName).append(extension); String instancePath = metadataStore.getInstance(instanceId).getPath(); return new File(instancePath, indexFileNameBuilder.toString()); } }
private File getWriterPath(String instanceId, String bagName) throws JasDBStorageException { String instancePath = metadataStore.getInstance(instanceId).getPath(); return new File(instancePath, bagName + BAG_EXTENSION); }
private void initializeServices() throws JasDBStorageException { for(Instance instanceMeta : metadataStore.getInstances()) { LOG.info("Loading instance: {} on path: {}", instanceMeta.getInstanceId(), instanceMeta.getPath()); instances.put(instanceMeta.getInstanceId(), new DBInstanceImpl(storageServiceFactory, metadataStore, instanceMeta)); } }
@Test public void testGetInstances() throws JasDBException { DBSession session = sessionFactory.createSession(); List<Instance> instanceList = session.getInstances(); assertEquals(1, instanceList.size()); Instance instance = instanceList.get(0); assertEquals("default", instance.getInstanceId()); assertEquals(jasdbHome, new File(instance.getPath()).toString()); }
public static SimpleEntity toEntity(Instance instance) { SimpleEntity entity = new SimpleEntity(); entity.addProperty(Constants.META_TYPE, Constants.INSTANCE_TYPE); entity.addProperty(Constants.INSTANCE, instance.getInstanceId()); entity.addProperty(Constants.INSTANCE_PATH, instance.getPath()); return entity; }