public boolean allLogUids (String tName, InputObjectState state, int match) throws ObjectStoreException { return super.allObjUids(tName, state, match); }
public FileSystemStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBean) throws ObjectStoreException { super(objectStoreEnvironmentBean); fullStoreName = locateStore(_objectStoreRoot); doSync = objectStoreEnvironmentBean.isObjectStoreSync(); scanZeroLengthFiles = objectStoreEnvironmentBean.isScanZeroLengthFiles(); /* The root of the objectstore must exist and be writable */ if ((fullStoreName == null) || !createHierarchy(fullStoreName)) { throw new ObjectStoreException( tsLogger.i18NLogger.get_objectstore_FileSystemStore_1(fullStoreName) ); } }
protected String genPathName (Uid objUid, String tName, int ft) throws ObjectStoreException { String fname = super.genPathName(objUid, tName, ft); if (ft == StateStatus.OS_UNCOMMITTED) fname = fname + HIDDENCHAR; return fname; }
OutputObjectState store = new OutputObjectState(); Uid aUid = new Uid(entry[i], true); if (!aUid.valid() || (aUid.equals(Uid.nullUid()))) String revealed = revealedId(entry[i]); if (present(revealed, entry)) aUid = null; else if ((aUid.notEquals(Uid.nullUid())) && ((match == StateStatus.OS_UNKNOWN) || (isType(aUid, tName, match)))) throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_2a(), e); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_3(), e); state.setBuffer(store.buffer());
return true; OutputObjectState store = new OutputObjectState(); if (!supressEntry(entry[i])) store.packString(entry[i]); result = allTypes(store, entry[i]); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_4(), e); store.packString(""); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_5(), e); foundTypes.setBuffer(store.buffer());
InputObjectState logs = new InputObjectState(); OutputObjectState objUids = new OutputObjectState(); if (!super.allObjUids(tName, logs, match)) return false; else Uid logName = new Uid(Uid.nullUid()); if (logName.notEquals(Uid.nullUid())) UidHelper.packInto(txs.get(i).stateUid(), objUids); UidHelper.packInto(Uid.nullUid(), objUids); state.setBuffer(objUids.buffer());
return true; OutputObjectState store = new OutputObjectState(); if (!supressEntry(entry[i])) store.packString(entry[i]); result = allTypes(store, entry[i]); throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_4"), e); store.packString(""); throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_5"), e); foundTypes.setBuffer(store.buffer());
if (!supressEntry(entry[i])) String pack = truncate(entry[i]); foundTypes.packString(root+File.separator+pack); result = allTypes(foundTypes, root+File.separator+pack); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_7(), e);
int imageSize = (int) state.length(); tsLogger.i18NLogger.warn_objectstore_ShadowingStore_18(fname); ofile.write(state.buffer(), 0, imageSize); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed to sync for " + fname, e); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed to locate file " + fname + ": " + e, e); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed for " + fname + ": " + e, e); tsLogger.i18NLogger.warn_objectstore_ShadowingStore_19(fname); super.addToCache(fname); throw new ObjectStoreException( "ShadowStore::write_state - " + tsLogger.i18NLogger.get_objectstore_notypenameuid() + objUid);
protected File openAndLock (String fname, int lmode, boolean create) throws ObjectStoreException { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("FileSystemStore.openAndLock(" + fname + ", " + FileLock.modeString(lmode) + ", " + create + ")"); } // File fd = (File) FdCache(fname); File fd = null; if (fd == null) { fd = new File(fname); if (!fd.exists()) { if (createHierarchy(fname)) { if (!lock(fd, lmode, create)) { return null; } else return fd; } else throw new ObjectStoreException("FileSystemStore.openAndLock failed to create hierarchy "+fname); } if (!lock(fd, lmode, create)) fd = null; } return fd; }
String storeName = locateStore(getStoreName()); String cPtr = null; String fname = null; String os = objUid.fileStringForm(); // convert all ':' to '_' to be portable across file systems.
tsLogger.i18NLogger.warn_objectstore_ShadowingStore_2(shadow, filename); super.addToCache(filename); super.removeFromCache(shadow); throw new ObjectStoreException( "ShadowStore::commit_state - " + tsLogger.i18NLogger.get_objectstore_notypenameuid() + objUid);
/** * If this object store implementation is exclusively working on a set of * object states, then this method will check a file cache first. * Otherwise, we must go back to the file system each time to check the * status of the file. * * If we add a FileDescriptor cache a la the C++ version then we would * be able to get rid of the state cache and simply check to see if we * had a fd for it. */ protected final boolean exists (String path) { if (super.shareStatus == ObjectStore.OS_UNSHARED) { if (FileSystemStore.fileCache.get(path) != null) return true; } /* * If here then we need to check the file system. If there, we will * put it into the cache (if appropriate). */ File f = new File(path); boolean doesExist = f.exists(); if (doesExist) addToCache(path); return doesExist; }
protected synchronized boolean setupStore (String localOSRoot) throws ObjectStoreException { if (tsLogger.arjLogger.isDebugEnabled()) { tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PROTECTED, FacilityCode.FAC_OBJECT_STORE, "FileSystemStore.setupStore("+localOSRoot+")"); } isValid = true; if (localOSRoot == null) localOSRoot = ""; localStoreRoot = localOSRoot; fullStoreName = locateStore(localStoreRoot); /* The root of the objectstore must exist and be writable */ if ((fullStoreName == null) || !createHierarchy(fullStoreName)) { if (tsLogger.arjLoggerI18N.isWarnEnabled()) { tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_1", new Object[]{fullStoreName}); } isValid = false; } return isValid; }
OutputObjectState store = new OutputObjectState(); Uid aUid = new Uid(entry[i], true); if (!aUid.valid() || (aUid.equals(Uid.nullUid()))) String revealed = revealedId(entry[i]); if (present(revealed, entry)) aUid = null; else if ((aUid.notEquals(Uid.nullUid())) && ((match == StateStatus.OS_UNKNOWN) || (isType(aUid, tName, match)))) throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_2a(), e); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_3(), e); state.setBuffer(store.buffer());
return true; OutputObjectState store = new OutputObjectState(); if (!supressEntry(entry[i])) store.packString(entry[i]); result = allTypes(store, entry[i]); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_4(), e); store.packString(""); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_5(), e); foundTypes.setBuffer(store.buffer());
InputObjectState logs = new InputObjectState(); OutputObjectState objUids = new OutputObjectState(); if (!super.allObjUids(tName, logs, match)) return false; else Uid logName = new Uid(Uid.nullUid()); if (logName.notEquals(Uid.nullUid())) UidHelper.packInto(txs.get(i).stateUid(), objUids); UidHelper.packInto(Uid.nullUid(), objUids); state.setBuffer(objUids.buffer());
if (!supressEntry(entry[i])) String pack = truncate(entry[i]); foundTypes.packString(root+File.separator+pack); result = allTypes(foundTypes, root+File.separator+pack); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_7(), e);
int imageSize = (int) state.length(); tsLogger.i18NLogger.warn_objectstore_ShadowingStore_18(fname); ofile.write(state.buffer(), 0, imageSize); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed to sync for " + fname, e); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed to locate file " + fname + ": " + e, e); throw new ObjectStoreException( "ShadowingStore::write_state() - write failed for " + fname + ": " + e, e); tsLogger.i18NLogger.warn_objectstore_ShadowingStore_19(fname); super.addToCache(fname); throw new ObjectStoreException( "ShadowStore::write_state - " + tsLogger.i18NLogger.get_objectstore_notypenameuid() + objUid);
if (createHierarchy(fname)) if (!lock(fd, lmode, create)) throw new ObjectStoreException("FileSystemStore.openAndLock failed to create hierarchy "+fname); if (!lock(fd, lmode, create)) fd = null;