All Downloads are FREE. Search and download functionalities are using the official Maven repository.

alluxio.client.file.policy.FileWriteLocationPolicy Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.client.file.policy;

import alluxio.annotation.PublicApi;
import alluxio.client.block.BlockWorkerInfo;
import alluxio.client.file.FileOutStream;
import alluxio.wire.WorkerNetAddress;

import java.util.List;

/**
 * 

* Interface for the location policy of which workers a file's blocks are written into. A location * policy instance is used only once per file write. *

* *

* The {@link FileOutStream} calls {@link #getWorkerForNextBlock(List, long)} to decide which worker * to write the next block per block write. *

* *

* A policy must have an empty constructor to be used as default policy. *

*/ @PublicApi public interface FileWriteLocationPolicy { /** * Gets the worker's host name for the next block to write to. * * @param workerInfoList the info of the active workers * @param blockSizeBytes the size of the block in bytes * @return the address of the worker to write to */ WorkerNetAddress getWorkerForNextBlock(List workerInfoList, long blockSizeBytes); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy