#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <jni.h>
Go to the source code of this file.
Data Structures | |
struct | hdfsFile_internal |
struct | hdfsFileInfo |
Defines | |
#define | O_RDONLY 1 |
#define | O_WRONLY 2 |
#define | EINTERNAL 255 |
Typedefs | |
typedef int32_t | tSize |
typedef time_t | tTime |
size of data for read/write io ops | |
typedef int64_t | tOffset |
time type in seconds | |
typedef uint16_t | tPort |
offset within the file | |
typedef enum tObjectKind | tObjectKind |
port | |
typedef void * | hdfsFS |
typedef hdfsFile_internal * | hdfsFile |
Enumerations | |
enum | hdfsStreamType { UNINITIALIZED = 0, INPUT = 1, OUTPUT = 2 } |
Functions | |
hdfsFS | hdfsConnectAsUser (const char *host, tPort port, const char *user, const char *groups[], int groups_size) |
hdfsFS | hdfsConnect (const char *host, tPort port) |
int | hdfsDisconnect (hdfsFS fs) |
hdfsFile | hdfsOpenFile (hdfsFS fs, const char *path, int flags, int bufferSize, short replication, tSize blocksize) |
int | hdfsCloseFile (hdfsFS fs, hdfsFile file) |
int | hdfsExists (hdfsFS fs, const char *path) |
int | hdfsSeek (hdfsFS fs, hdfsFile file, tOffset desiredPos) |
tOffset | hdfsTell (hdfsFS fs, hdfsFile file) |
tSize | hdfsRead (hdfsFS fs, hdfsFile file, void *buffer, tSize length) |
tSize | hdfsPread (hdfsFS fs, hdfsFile file, tOffset position, void *buffer, tSize length) |
tSize | hdfsWrite (hdfsFS fs, hdfsFile file, const void *buffer, tSize length) |
int | hdfsFlush (hdfsFS fs, hdfsFile file) |
int | hdfsAvailable (hdfsFS fs, hdfsFile file) |
int | hdfsCopy (hdfsFS srcFS, const char *src, hdfsFS dstFS, const char *dst) |
int | hdfsMove (hdfsFS srcFS, const char *src, hdfsFS dstFS, const char *dst) |
int | hdfsDelete (hdfsFS fs, const char *path) |
int | hdfsRename (hdfsFS fs, const char *oldPath, const char *newPath) |
char * | hdfsGetWorkingDirectory (hdfsFS fs, char *buffer, size_t bufferSize) |
int | hdfsSetWorkingDirectory (hdfsFS fs, const char *path) |
int | hdfsCreateDirectory (hdfsFS fs, const char *path) |
int | hdfsSetReplication (hdfsFS fs, const char *path, int16_t replication) |
hdfsFileInfo * | hdfsListDirectory (hdfsFS fs, const char *path, int *numEntries) |
hdfsFileInfo * | hdfsGetPathInfo (hdfsFS fs, const char *path) |
void | hdfsFreeFileInfo (hdfsFileInfo *hdfsFileInfo, int numEntries) |
char *** | hdfsGetHosts (hdfsFS fs, const char *path, tOffset start, tOffset length) |
void | hdfsFreeHosts (char ***blockHosts) |
tOffset | hdfsGetDefaultBlockSize (hdfsFS fs) |
tOffset | hdfsGetCapacity (hdfsFS fs) |
tOffset | hdfsGetUsed (hdfsFS fs) |
int | hdfsChown (hdfsFS fs, const char *path, const char *owner, const char *group) |
int | hdfsChmod (hdfsFS fs, const char *path, short mode) |
int | hdfsUtime (hdfsFS fs, const char *path, tTime mtime, tTime atime) |
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
|
|
|
|
|
The C reflection of org.apache.org.hadoop.FileSystem . |
|
port
|
|
time type in seconds
|
|
offset within the file
|
|
Some utility decls used in libhdfs. |
|
size of data for read/write io ops
|
|
The C equivalent of org.apache.org.hadoop.FSData(Input|Output)Stream . |
|
hdfsAvailable - Number of bytes that can be read from this input stream without blocking.
|
|
hdfsChmod
|
|
hdfsChown
|
|
hdfsCloseFile - Close an open file.
|
|
hdfsConnect - Connect to a hdfs file system. Connect to the hdfs.
|
|
hdfsConnectAsUser - Connect to a hdfs file system as a specific user Connect to the hdfs.
|
|
hdfsCopy - Copy file from one filesystem to another.
|
|
hdfsCreateDirectory - Make the given file and all non-existent parents into directories.
|
|
hdfsDelete - Delete file.
|
|
hdfsDisconnect - Disconnect from the hdfs file system. Disconnect from hdfs.
|
|
hdfsExists - Checks if a given path exsits on the filesystem
|
|
hdfsWrite - Flush the data.
|
|
hdfsFreeFileInfo - Free up the hdfsFileInfo array (including fields)
|
|
hdfsFreeHosts - Free up the structure returned by hdfsGetHosts
|
|
hdfsGetCapacity - Return the raw capacity of the filesystem.
|
|
hdfsGetDefaultBlockSize - Get the optimum blocksize.
|
|
hdfsGetHosts - Get hostnames where a particular block (determined by pos & blocksize) of a file is stored. The last element in the array is NULL. Due to replication, a single block could be present on multiple hosts.
|
|
hdfsGetPathInfo - Get information about a path as a (dynamically allocated) single hdfsFileInfo struct. hdfsFreeFileInfo should be called when the pointer is no longer needed.
|
|
hdfsGetUsed - Return the total raw size of all files in the filesystem.
|
|
hdfsGetWorkingDirectory - Get the current working directory for the given filesystem.
|
|
hdfsListDirectory - Get list of files/directories for a given directory-path. hdfsFreeFileInfo should be called to deallocate memory.
|
|
hdfsMove - Move file from one filesystem to another.
|
|
hdfsOpenFile - Open a hdfs file in given mode.
|
|
hdfsPread - Positional read of data from an open file.
|
|
hdfsRead - Read data from an open file.
|
|
hdfsRename - Rename file.
|
|
hdfsSeek - Seek to given offset in file. This works only for files opened in read-only mode.
|
|
hdfsSetReplication - Set the replication of the specified file to the supplied value
|
|
hdfsSetWorkingDirectory - Set the working directory. All relative paths will be resolved relative to it.
|
|
hdfsTell - Get the current offset in the file, in bytes.
|
|
hdfsUtime
|
|
hdfsWrite - Write data into an open file.
|