Example #1
0
 public NIOFSDirectory(System.IO.DirectoryInfo dir, LockFactory lockFactory)
 {
 }
Example #2
0
 public NIOFSDirectory(System.IO.DirectoryInfo dir, LockFactory lockFactory)
     : base(dir, lockFactory)
 {
     throw new System.NotImplementedException("Waiting for volunteers to implement this class");
 }
Example #3
0
 public override void SetLockFactory(LockFactory lf)
 {
     _lockFactory = lf;
     //_realDirectory.SetLockFactory(lf);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SPDirectory" /> class.
 /// </summary>
 /// <param name="folderUrl"></param>
 /// <param name="lockFactory"></param>
 /// <exception cref="System.ArgumentNullException">siteId</exception>
 public SPDirectory(string folderUrl, LockFactory lockFactory)
     : this(folderUrl, lockFactory, null)
 {
 }
 public void ReadToWriteFails()
 {
     using (ILockStrategy l = LockFactory.Create())
         using (l.Read())
             Assert.IsFalse(l.TryWrite(10));
 }
Example #6
0
 private DagStorage(LockType lockType)
 {
     _lock = LockFactory.Create(lockType);
 }
Example #7
0
        private static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d, LockFactory lf, bool bare)
        {
            string fsdirClass = TEST_DIRECTORY;
            if (fsdirClass.Equals("random"))
            {
                fsdirClass = RandomInts.RandomFrom(Random(), FS_DIRECTORIES);
            }

            Type clazz;
            try
            {
                clazz = CommandLineUtil.LoadFSDirectoryClass(fsdirClass);
            }
            catch (System.InvalidCastException e)
            {
                // TEST_DIRECTORY is not a sub-class of FSDirectory, so draw one at random
                fsdirClass = RandomInts.RandomFrom(Random(), FS_DIRECTORIES);
                clazz = CommandLineUtil.LoadFSDirectoryClass(fsdirClass);
            }

            Directory fsdir = NewFSDirectoryImpl(clazz, d);
            BaseDirectoryWrapper wrapped = WrapDirectory(Random(), fsdir, bare);
            if (lf != null)
            {
                wrapped.LockFactory = lf;
            }
            return wrapped;
        }
Example #8
0
        /// <summary>
        /// Create a new WindowsDirectory for the named location.
        /// </summary>
        /// <param name="path"> the path of the directory </param>
        /// <param name="lockFactory"> the lock factory to use, or null for the default
        /// (<seealso cref="NativeFSLockFactory"/>); </param>
        /// <exception cref="IOException"> If there is a low-level I/O error </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public WindowsDirectory(java.io.File path, LockFactory lockFactory) throws java.io.IOException
        public WindowsDirectory(File path, LockFactory lockFactory) : base(path, lockFactory)
        {
        }
		/// <param name="id">should be a unique id across all clients
		/// </param>
		/// <param name="lf">the LockFactory that we are testing
		/// </param>
		/// <param name="host">host or IP where <see cref="LockVerifyServer" />
		/// is running
		/// </param>
		/// <param name="port">the port <see cref="LockVerifyServer" /> is
		/// listening on
		/// </param>
		public VerifyingLockFactory(sbyte id, LockFactory lf, System.String host, int port)
		{
			this.id = id;
			this.lf = lf;
			this.host = host;
			this.port = port;
		}
 /// <summary>Just like <see cref="Open(System.IO.DirectoryInfo)" />, but allows you to
 /// also specify a custom <see cref="LockFactory" />.
 /// </summary>
 public static MemoryMappedDirectory Open(System.IO.DirectoryInfo path, LockFactory lockFactory)
 {
     return(new MemoryMappedDirectory(path, lockFactory));
 }
 public MockLockFactoryWrapper(MockDirectoryWrapper dir, LockFactory @delegate)
 {
     this.dir       = dir;
     this.@delegate = @delegate;
 }
Example #12
0
 /// <summary>
 /// Create a new WindowsDirectory for the named location.
 /// </summary>
 /// <param name="path"> the path of the directory </param>
 /// <param name="lockFactory"> the lock factory to use, or null for the default
 /// (<seealso cref="NativeFSLockFactory"/>); </param>
 /// <exception cref="IOException"> If there is a low-level I/O error </exception>
 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public WindowsDirectory(java.io.File path, LockFactory lockFactory) throws java.io.IOException
 public WindowsDirectory(File path, LockFactory lockFactory)
     : base(path, lockFactory)
 {
 }
Example #13
0
		public LuceneIndexer() {
			_indexRootDirectory = HttpContext.Current.Server.MapPath("~/assets/index");
			_spellRootDirectory = HttpContext.Current.Server.MapPath("~/assets/spell");
			IndexDirectoryInfo = new DirectoryInfo(_indexRootDirectory);
			LockFactory = new SimpleFSLockFactory();
		}
 public void TestThreadedWriteTimeout()
 {
     using (ILockStrategy l = LockFactory.Create())
         using (new ThreadedWriter(l))
             using (l.Write(0)) { }
 }
Example #15
0
 public override void SetLockFactory(LockFactory lockFactory)
 {
     _lockFactory = lockFactory;
 }
 public MemoryMappedDirectory(DirectoryInfo dInfo, LockFactory lockFactory)
     : base(dInfo, lockFactory)
 {
 }
 public void TestExcessiveReleaseRead()
 {
     using (ILockStrategy l = LockFactory.Create())
         l.ReleaseRead();
 }
Example #18
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     _lockFactory?.Dispose();
     _lockFactory = null;
 }
Example #19
0
 /// <summary>
 /// Returns a new FSDirectory instance over the given file, which must be a folder. </summary>
 public static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d, LockFactory lf)
 {
     return NewFSDirectory(d, lf, Rarely());
 }
Example #20
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="jobScheduler">Job scheduler</param>
 public FractalLfgReminderService(JobScheduler jobScheduler)
 {
     _jobScheduler = jobScheduler;
     _lockFactory  = new LockFactory();
 }
 public MockLockFactoryWrapper(MockDirectoryWrapper dir, LockFactory @delegate)
 {
     this.Dir = dir;
     this.@delegate = @delegate;
 }
Example #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SPDirectory" /> class.
 /// </summary>
 /// <param name="folder">The folder.</param>
 /// <param name="lockFactory">The lock factory.</param>
 /// <exception cref="System.ArgumentNullException">folder</exception>
 public SPDirectory(SPFolder folder, LockFactory lockFactory)
     : this(folder, lockFactory, null)
 {
 }