Package freenet.client

Examples of freenet.client.InsertContext


                return UpdateOverMandatoryManager.this;
            }

    };
    // We are inserting a binary blob so we don't need to worry about CompatibilityMode etc.
    InsertContext ctx = updateManager.node.clientCore.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, false).getInsertContext(true);
    ClientPutter putter = new ClientPutter(callback, bucket,
      FreenetURI.EMPTY_CHK_URI, null, ctx,
      RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, null, true, updateManager.node.clientCore.clientContext, null, -1);
    try {
      updateManager.node.clientCore.clientContext.start(putter);
View Full Code Here


        });
       
    archiveManager = new ArchiveManager(MAX_ARCHIVE_HANDLERS, MAX_CACHED_ARCHIVE_DATA, MAX_ARCHIVED_FILE_SIZE, MAX_CACHED_ELEMENTS, tempBucketFactory);

    healingQueue = new SimpleHealingQueue(
        new InsertContext(
            0, 2, 0, 0, new SimpleEventProducer(),
            false, Node.FORK_ON_CACHEABLE_DEFAULT, false, Compressor.DEFAULT_COMPRESSORDESCRIPTOR, 0, 0, InsertContext.CompatibilityMode.COMPAT_DEFAULT), RequestStarter.PREFETCH_PRIORITY_CLASS, 512 /* FIXME make configurable */);

    PooledFileRandomAccessBufferFactory raff =
        new PooledFileRandomAccessBufferFactory(persistentFilenameGenerator, node.fastWeakRandom);
    persistentDiskChecker =
        new DiskSpaceCheckingRandomAccessBufferFactory(raff, persistentTempDir.dir(),
                minDiskFreeLongTerm + tempBucketFactory.getMaxRamUsed());
    persistentRAFFactory = new MaybeEncryptedRandomAccessBufferFactory(persistentDiskChecker, nodeConfig.getBoolean("encryptPersistentTempBuckets"));
    persistentTempBucketFactory.setDiskSpaceChecker(persistentDiskChecker);
    HighLevelSimpleClient client = makeClient((short)0, false, false);
    FetchContext defaultFetchContext = client.getFetchContext();
    InsertContext defaultInsertContext = client.getInsertContext(false);
    int maxMemoryLimitedJobThreads = Runtime.getRuntime().availableProcessors() / 2; // Some disk I/O ... tunable REDFLAG
    maxMemoryLimitedJobThreads = Math.min(maxMemoryLimitedJobThreads, node.nodeStats.getThreadLimit()/20);
    maxMemoryLimitedJobThreads = Math.max(1, maxMemoryLimitedJobThreads);
        // FIXME review thread limits. This isn't just memory, it's CPU and disk as well, so we don't want it too big??
        // FIXME l10n the errors?
View Full Code Here

    public FetchContext getDefaultPersistentFetchContext() {
        return new FetchContext(defaultPersistentFetchContext, FetchContext.IDENTICAL_MASK);
    }
   
    public InsertContext getDefaultPersistentInsertContext() {
        return new InsertContext(defaultPersistentInsertContext, new SimpleEventProducer());
    }
View Full Code Here

    InsertableClientSSK ark = crypto.myARK;
    FreenetURI uri = ark.getInsertURI().setKeyType("USK").setSuggestedEdition(number);
   
    if(logMINOR) Logger.minor(this, "Inserting " + darknetOpennetString + " ARK: " + uri + "  contents:\n" + s);
   
    InsertContext ctx = node.clientCore.makeClient((short)0, true, false).getInsertContext(true);
    inserter = new ClientPutter(this, b, uri,
          null, // Modern ARKs easily fit inside 1KB so should be pure SSKs => no MIME type; this improves fetchability considerably
          ctx,
          RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, null, false, node.clientCore.clientContext, null, -1);
   
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        context.earlyEncode = true;
        KeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        KeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
                r, memoryLimitedJobRunner, jobRunner, ticker, keys, false, 0, 0, 0, 0);
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        context.maxInsertRetries = 2;
        MyKeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        context.maxInsertRetries = 2;
        context.consecutiveRNFsCountAsSuccess = 2;
        MyKeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        context.maxInsertRetries = 2;
        MyKeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
View Full Code Here

        Random r = new Random(12121);
        long size = 65536; // Exact multiple, so no last block
        LockableRandomAccessBuffer data = generateData(r, size, smallRAFFactory);
        HashResult[] hashes = getHashes(data);
        MyCallback cb = new MyCallback();
        InsertContext context = baseContext.clone();
        context.maxInsertRetries = 0;
        context.consecutiveRNFsCountAsSuccess = 2;
        MyKeysFetchingLocally keys = new MyKeysFetchingLocally();
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
View Full Code Here

TOP

Related Classes of freenet.client.InsertContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.