# File systems

FileSystem is an abstraction provided by Pinot to access data in distributed file systems

Pinot uses the distributed file systems or the following purposes -

* Batch Ingestion Job - To read the input data (CSV, Avro, Thrift etc.) and to write generated segments to DFS
* Controller - When a segment is uploaded to controller, the controller saves it in the DFS configured.
* Server - When a server(s) is notified of a new segment, the server copy the segment from remote DFS to their local node using the DFS abstraction

Pinot allows you to choose the distributed file system provider. Currently, the following file systems are supported by Pinot out of the box.

* [Amazon S3](/release-0.9.0/basics/data-import/pinot-file-system/amazon-s3.md)
* [Google Cloud Storage](/release-0.9.0/basics/data-import/pinot-file-system/import-from-gcp.md)
* [HDFS](/release-0.9.0/basics/data-import/pinot-file-system/import-from-hdfs.md)
* [Azure Data Lake Storage](/release-0.9.0/basics/data-import/pinot-file-system/import-from-adls-azure.md)

To use a distributed file-system, you need to enable plugins in pinot. To do that, specify the plugin directory and include the required plugins -

```
-Dplugins.dir=/opt/pinot/plugins -Dplugins.include=pinot-plugin-to-include-1,pinot-plugin-to-include-2
```

Now, You can proceed to change the filesystem in the `controller` and `server` config as follows -

```
#CONTROLLER

pinot.controller.storage.factory.class.[scheme]=className of the pinot file systems
pinot.controller.segment.fetcher.protocols=file,http,[scheme]
pinot.controller.segment.fetcher.[scheme].class=org.apache.pinot.common.utils.fetcher.PinotFSSegmentFetcher
```

```
#SERVER

pinot.server.storage.factory.class.[scheme]=className of the pinotfile systems
pinot.server.segment.fetcher.protocols=file,http,[scheme]
pinot.server.segment.fetcher.[scheme].class=org.apache.pinot.common.utils.fetcher.PinotFSSegmentFetcher
```

Here, `scheme` refers to the prefix used in URI of the filesystem. e.g. for the URI, `s3://bucket/path/to/file` the scheme is `s3`

You can also change the filesystem during ingestion. In the ingestion job spec, specify the filesystem with the following config -&#x20;

```
pinotFSSpecs
  - scheme: file
    className: org.apache.pinot.spi.filesystem.LocalPinotFS
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pinot.apache.org/release-0.9.0/basics/data-import/pinot-file-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
