Creates {@code FileIndex} assembled by this builder.

@return {@code FileIndex} assembled by this builder
433958
public FileIndex createAndDestroy() {
        checkIfDestroyed();
        destroyed = true;
        return new FileIndex(step, metadata, index, startingRecordNumber, lastAccessibleRecordNumber());
    }
1215217
public static FileIndex read(InputStream stream) throws IOException {
        //Creating raw input stream
        DataInputStream raw = new DataInputStream(stream);

        //Reading magic number
        int magic = raw.readInt();
        if (magic != MAGIC)
            throw new IOException("Wrong magic number");

        //Reading length
        int length = raw.readInt();

        //Reading whole index
        byte[] buffer = new byte[length];
        raw.read(buffer);

        //Creating uncompressed stream
        InflaterInputStream inflater = new InflaterInputStream(new ByteArrayInputStream(buffer));
        DataInputStream dataStream = new DataInputStream(inflater);

        //Reading step
        long step = dataStream.readLong();
        long startingRecordNumner = dataStream.readLong();
        long lastRecordNumber = dataStream.readLong();

        //Reading meta record count
        int metaRecordsCount = dataStream.readInt();

        //Reading meta records
        Map<String, String> metadata = new HashMap<>();
        String key, value;
        while (--metaRecordsCount >= 0) {
            key = dataStream.readUTF();
            value = dataStream.readUTF();
            metadata.put(key, value);
        }

        //Reading entries number
        int size = dataStream.readInt();

        //Creating array for index
        TLongArrayList index = new TLongArrayList(size);

        //Reading index
        long last = 0, val;
        for (int i = 0; i < size; ++i) {
            val = IOUtil.readRawVarint64(dataStream, -1);
            if (val == -1)
                throw new IOException("Wrong file format");
            last += val;
            index.add(last);
        }

        return new FileIndex(step, metadata, index, startingRecordNumner, lastRecordNumber);
    }
1331205
function createIndices(callback) {
      const q = queue();
      geojson_files.forEach((gj) => {
        q.defer(createIndex, gj);
      });

      q.awaitAll((err) => {
        if (err) return callback(err);
        return callback();
      });
    }
1188391
public static DeploymentReflectionIndex create() {
        final SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(ServerPermission.CREATE_DEPLOYMENT_REFLECTION_INDEX);
        }
        return new DeploymentReflectionIndex();
    }
84690
public alluxio.grpc.FileInfoOrBuilder getFileInfoOrBuilder() {
    return fileInfo_ == null ? alluxio.grpc.FileInfo.getDefaultInstance() : fileInfo_;
  }
333495
private File createFilename(String filenamePrefix, File journalDirectory)
            throws JournalException {
        String filename =
                JournalHelper.createTimestampedFilename(filenamePrefix,
                                                        new Date());
        File theFile = new File(journalDirectory, filename);

        if (theFile.exists()) {
            throw new JournalException("File '" + theFile.getPath()
                    + "' already exists.");
        }

        return theFile;
    }
1264039
public File createFileSync(String prefix, String suffix) throws IOException {
		File tmp;
		if (tempDir == null)
			tmp = File.createTempFile(this.prefix + prefix, suffix);
		else
			tmp = File.createTempFile(this.prefix + prefix, suffix, tempDir);
		tmp.deleteOnExit();
		return tmp;
	}
1185963
public static final File createTempDir() throws IOException
   {
      File dir = File.createTempFile("mpxj", "tmp");
      delete(dir);
      mkdirs(dir);
      return dir;
   }
451097
public FileFilter build() {
        if (filenames.isEmpty() && extensions.isEmpty() && fileFilters.isEmpty()) {
            throw new IllegalStateException("May only be invoked after at least one add... method has been invoked.");
        }
        final OrFileFilter filter = new OrFileFilter();
        if (!filenames.isEmpty()) {
            filter.addFileFilter(new NameFileFilter(new ArrayList<>(filenames)));
        }
        if (!extensions.isEmpty()) {
            filter.addFileFilter(new SuffixFileFilter(new ArrayList<>(extensions), IOCase.INSENSITIVE));
        }
        for (IOFileFilter iof : fileFilters) {
            filter.addFileFilter(iof);
        }
        return filter;
    }
10408
protected String createIndexBackup() {

        if (!isBackupReindexing()) {
            // if no backup is generated we don't need to do anything
            return null;
        }

        // check if the target directory already exists
        File file = new File(getPath());
        if (!file.exists()) {
            // index does not exist yet, so we can't backup it
            return null;
        }
        String backupPath = getPath() + "_backup";
        FSDirectory oldDir = null;
        FSDirectory newDir = null;
        try {
            // open file directory for Lucene
            oldDir = FSDirectory.open(file.toPath());
            newDir = FSDirectory.open(Paths.get(backupPath));
            for (String fileName : oldDir.listAll()) {
                newDir.copyFrom(oldDir, fileName, fileName, IOContext.DEFAULT);
            }
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(Messages.LOG_IO_INDEX_BACKUP_CREATE_3, getName(), getPath(), backupPath),
                e);
            backupPath = null;
        } finally {
            if (oldDir != null) {
                try {
                    oldDir.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (newDir != null) {
                try {
                    newDir.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return backupPath;
    }
67985
public byte[] getFileHandle() throws IOException {
        if (_isRootFile) {
            return getNfs().getRootFileHandle();
        }
        if (_fileHandle == null) {
            setFileHandle();
        }
        return (_fileHandle == null) ? null : _fileHandle.clone();
    }
1073093
public AsyncWork<File, IOException> createFileAsync(String prefix, String suffix) {
		return new Task.OnFile<File, IOException>(tempDir, "Create temporary file", Task.PRIORITY_NORMAL) {
			@Override
			public File run() throws IOException {
				return createFileSync(prefix, suffix);
			}
		}.start().getOutput();
	}
367064
public OrderItem createOrderItem() {
        if (orderByItemSegment instanceof IndexOrderByItemSegment) {
            return createOrderItem((IndexOrderByItemSegment) orderByItemSegment);
        }
        if (orderByItemSegment instanceof ColumnOrderByItemSegment) {
            return createOrderItem(selectStatement, (ColumnOrderByItemSegment) orderByItemSegment);
        }
        if (orderByItemSegment instanceof ExpressionOrderByItemSegment) {
            return createOrderItem(selectStatement, (ExpressionOrderByItemSegment) orderByItemSegment);
        }
        throw new UnsupportedOperationException();
    }
263123
private boolean createIndex(String index, Map<String, Object> defaultSettings) {
        IndicesExistsResponse res = client.admin().indices().prepareExists(index).execute().actionGet();
        boolean created = false;
        if (!res.isExists()) {
            CreateIndexRequestBuilder req = client.admin().indices().prepareCreate(index);
            req.setSettings(defaultSettings);
            created = req.execute().actionGet().isAcknowledged();
            if (!created) {
                throw new RuntimeException("Could not create index [" + index + "]");
            }
        }

        return created;
    }
792421
function createIndex(dirPath) {
    const dirName = path.basename(dirPath)
    return format(`/** DON'T EDIT THIS FILE; was created by scripts. */
    "use strict"

    module.exports = {
        ${fs
            .readdirSync(dirPath)
            .map(file => path.basename(file, ".js"))
            .map(id => `"${id}": require("./${dirName}/${id}"),`)
            .join("\n    ")}
    }
    `)
}
1255449
public Path createIndex() throws IOException {
        Path indexPath = bamFile.getParent().resolve(bamFile.getFileName().toString() + ".bai");
        return createIndex(indexPath);
    }
532374
public Future<?> buildIndexAsync()
    {
        // if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
        boolean allAreBuilt = true;
        for (ColumnDefinition cdef : columnDefs)
        {
            if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(cdef.name.bytes)))
            {
                allAreBuilt = false;
                break;
            }
        }

        if (allAreBuilt)
            return null;

        // build it asynchronously; addIndex gets called by CFS open and schema update, neither of which
        // we want to block for a long period.  (actual build is serialized on CompactionManager.)
        Runnable runnable = new Runnable()
        {
            public void run()
            {
                baseCfs.forceBlockingFlush();
                buildIndexBlocking();
            }
        };
        FutureTask<?> f = new FutureTask<Object>(runnable, null);

        new Thread(f, "Creating index: " + getIndexName()).start();
        return f;
    }