public unsafe ICell LoadGenericCell(LocalMemoryStorage storage, long cellId) { var err = storage.GetLockedCellInfo(cellId, out int size, out ushort cellType, out byte *cellPtr, out int entryIndex); if (err != Trinity.TrinityErrorCode.E_SUCCESS) { throw new CellNotFoundException("Cannot access the cell."); } int seg = CompositeStorage.GetIntervalIndexByCellTypeID(cellType); return(CompositeStorage.s_GenericCellOperations[seg].UseGenericCell(cellId, cellPtr, entryIndex, cellType)); }
public unsafe ICellAccessor UseGenericCell(LocalMemoryStorage storage, long cellId, CellAccessOptions options) { var err = storage .GetLockedCellInfo(cellId, out int size, out ushort cellType, out byte *cellPtr, out int entryIndex); switch (err) { case Trinity.TrinityErrorCode.E_SUCCESS: break; case Trinity.TrinityErrorCode.E_CELL_NOT_FOUND: { if ((options & CellAccessOptions.ThrowExceptionOnCellNotFound) != 0) { throw new CellNotFoundException("The cell with id = " + cellId + " not found."); } else if ((options & CellAccessOptions.CreateNewOnCellNotFound) != 0) { throw new ArgumentException( "CellAccessOptions.CreateNewOnCellNotFound is not valid for this method. Cannot determine new cell type.", "options"); } else if ((options & CellAccessOptions.ReturnNullOnCellNotFound) != 0) { return(null); } else { throw new CellNotFoundException("The cell with id = " + cellId + " not found."); } } default: throw new CellNotFoundException("Cannot access the cell."); } int seg = CompositeStorage.GetIntervalIndexByCellTypeID(cellType); return(CompositeStorage.s_GenericCellOperations[seg].UseGenericCell(cellId, cellPtr, entryIndex, cellType, options)); }
public void SaveGenericCell(LocalMemoryStorage storage, CellAccessOptions writeAheadLogOptions, ICell cell) { int seg = CompositeStorage.GetIntervalIndexByCellTypeID(cell.CellType); CompositeStorage.s_GenericCellOperations[seg].SaveGenericCell(storage, writeAheadLogOptions, cell); }
public void SaveGenericCell(IKeyValueStore storage, long cellId, ICell cell) { int seg = CompositeStorage.GetIntervalIndexByCellTypeID(cell.CellType); CompositeStorage.s_GenericCellOperations[seg].SaveGenericCell(storage, cellId, cell); }
public ICell NewGenericCell(string cellType, string content) { int seg = CompositeStorage.GetIntervalIndexByCellTypeName(cellType); return(CompositeStorage.s_GenericCellOperations[seg].NewGenericCell(cellType, content)); }
public unsafe ICellAccessor UseGenericCell(long cellId, byte *cellPtr, int entryIndex, ushort cellType, CellAccessOptions options) { int seg = CompositeStorage.GetIntervalIndexByCellTypeID(cellType); return(CompositeStorage.s_GenericCellOperations[seg].UseGenericCell(cellId, cellPtr, entryIndex, cellType, options)); }
public ICellAccessor UseGenericCell(LocalMemoryStorage storage, long cellId, CellAccessOptions options, string cellType) { int seg = CompositeStorage.GetIntervalIndexByCellTypeName(cellType); return(CompositeStorage.s_GenericCellOperations[seg].UseGenericCell(storage, cellId, options, cellType)); }
public ushort GetCellType(string cellTypeString) { int seg = CompositeStorage.GetIntervalIndexByCellTypeName(cellTypeString); return(CompositeStorage.s_StorageSchemas[seg].GetCellType(cellTypeString)); }