コード例 #1
0
        private string SecurityCachePath(string tableName)
        {
            // Database Level Security (for table creation)
            if (tableName == "")
            {
                return(BinarySerializable.FullPath("security.bin"));
            }

            // Table-specific security
            string tablePath = Table.TableCachePath(tableName);

            return(Path.Combine(tablePath, "Metadata", "security.bin"));
        }
コード例 #2
0
        public static void Drop(string tableName)
        {
            string tablePath = BinarySerializable.FullPath(Path.Combine("Tables", tableName));

            // Not saved
            if (!Directory.Exists(tablePath))
            {
                return;
            }

            // Delete everything in the table folder (including any additional data, like security)
            Directory.Delete(tablePath, true);
        }
コード例 #3
0
        public void Save()
        {
            _locker.EnterReadLock();
            try
            {
                var tablePath = BinarySerializable.FullPath(Path.Combine("Tables", this.Name));
                Directory.CreateDirectory(tablePath);

                // Write parition data
                foreach (Partition p in _partitions)
                {
                    p.Write(Path.Combine(tablePath, StringExtensions.Format("{0}.bin", p.Mask)));
                }
            }
            finally
            {
                _locker.ExitReadLock();
            }
        }
コード例 #4
0
 /// <summary>
 ///  Returns the path where a Table with the given name will be serialized.
 ///  Used so that additional metadata (ex: security) can be written within it.
 /// </summary>
 /// <param name="tableName">TableName for which to return path</param>
 /// <returns>Full Path where Table will be serialized</returns>
 public static string TableCachePath(string tableName)
 {
     return(BinarySerializable.FullPath(Path.Combine("Tables", tableName)));
 }