HDFS is write-once only. That means, once you are done writing to a file, you cannot append/update to it.
The normal way to update data is to create new files in the same directory and treat the file in the directory as the same "logical" file. You may also want to periodically merge multiple files into a single file. Runping > -----Original Message----- > From: 张茂森 [mailto:[EMAIL PROTECTED] > Sent: Sunday, November 12, 2006 7:08 PM > To: [email protected] > Subject: How to use MapFile? > > Hi all: > > Now I want to do some operations like ‘update’ or ‘insert’, which can > describe like this: > > 1. I have a base dataset > > 2. Everyday I will get more data from other places, and then I want to > update or insert these new data into my base dataset. > > 3. After I’ve read API Doc, I think MapFile is a good way to solve this > problem. As far as I know, I only need to append my new data at the end of > base dataset, and update the index file of MapFile. I understand right? > > 4. If I am right, I want to know how to do these operations using MapFile. > > Firstly, I could only find MapFileOutputFormat and couldn’t find > MapFileInputFormat, so how to read the MapFile? > > Secondly, how to update the index and append the data? Do you have some > experience or samples? > > Any suggestion would be appreciated. > > Thank you!
