You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2006/08/11 23:10:13 UTC
[jira] Created: (HADOOP-451) Add a Split interface
Add a Split interface
---------------------
Key: HADOOP-451
URL: http://issues.apache.org/jira/browse/HADOOP-451
Project: Hadoop
Issue Type: Improvement
Components: mapred
Reporter: Doug Cutting
Fix For: 0.6.0
The InputFormat interface has a method:
FileSplit[] getSplits();
This should change to:
Split[] getSplits();
The Split interface would look like:
public interface Split extends Writable {
/** Returns a list of hosts that contain this split.
This is only used to optimize task placement, so this may be empty. */
String[] getLocations(FileSystem fs);
/** The relative, estimated cost of operating on this. Typically the size of the data in the split.
Used to prioritize tasks in a job (high-cost tasks are run first). */
long getCost();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (HADOOP-451) Add a Split interface
Posted by Doug Cutting <cu...@apache.org>.
Bryan A. Pendleton wrote:
> Maybe I'm reading the code wrong.
>
> It looks to me like the FileSplit that gets used by a MapTaskRunner comes
> from the instantiation of a FileSplit in MapTask.java, which
> deserializes it
> from a stream. In the very least, if MapTasks stay Writable, then that code
> is wrong.
You're right. That code will have to be changed to use
ObjectWritable.writeObject() and ObjectWritable.readObject(), so that
the subclass name is written too.
Doug
Re: [jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Bryan A. Pendleton" <bp...@geekdom.net>.
Maybe I'm reading the code wrong.
It looks to me like the FileSplit that gets used by a MapTaskRunner comes
from the instantiation of a FileSplit in MapTask.java, which deserializes it
from a stream. In the very least, if MapTasks stay Writable, then that code
is wrong. I got the impression that the Task which ends up getting executed
goes through RPC this way. So, when a MapTask gets assigned, and the
readFields() gets called on the other end, it will be FileSplit.readFields()
getting called, with no awareness of the actual type of Split that was
present.
Now that I've run through that process, and assuming my spiel is correct -
then won't it be necessary to fix MapTask to correctly re-create the right
type of Split on deserialization?
On 8/14/06, Doug Cutting (JIRA) <ji...@apache.org> wrote:
>
> [
> http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12427953]
>
> Doug Cutting commented on HADOOP-451:
> -------------------------------------
>
> > You will probably need to add a "setSplitClass" and "getSplitClass" to
> JobConf
>
> The InputFormat is a Split factory, no? Who else would need to create
> Splits?
>
> Splits are passed in RPCs, and the RPC mechanism supports
> polymorphism. Splits are not written to files, so I see no reason to
> declare a fixed class per job. Am I missing something?
>
> > Add a Split interface
> > ---------------------
> >
> > Key: HADOOP-451
> > URL: http://issues.apache.org/jira/browse/HADOOP-451
> > Project: Hadoop
> > Issue Type: Improvement
> > Components: mapred
> > Reporter: Doug Cutting
> > Fix For: 0.6.0
> >
> >
> > The InputFormat interface has a method:
> > FileSplit[] getSplits();
> > This should change to:
> > Split[] getSplits();
> > The Split interface would look like:
> > public interface Split extends Writable {
> > /** Returns a list of hosts that contain this split.
> > This is only used to optimize task placement, so this may be
> empty. */
> > String[] getLocations(FileSystem fs);
> > /** The relative, estimated cost of operating on this. Typically the
> size of the data in the split.
> > Used to prioritize tasks in a job (high-cost tasks are run
> first). */
> > long getCost();
> > }
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
--
Bryan A. P. Pendleton
Ph: (877) geek-1-bp
[jira] Assigned: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=all ]
Owen O'Malley reassigned HADOOP-451:
------------------------------------
Assignee: Owen O'Malley
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12430085 ]
Doug Cutting commented on HADOOP-451:
-------------------------------------
In a comment on HADOOP-372, Owen suggests that the getSplits() method should look like:
Split[] getSplits(URI[], JobConf, int numMaps);
I think that's a good idea.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
> Fix For: 0.6.0
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12458985 ]
Hadoop QA commented on HADOOP-451:
----------------------------------
+1, because http://issues.apache.org/jira/secure/attachment/12347325/input-split-2.patch applied and successfully tested against trunk revision r487715.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split-2.patch, input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=all ]
Owen O'Malley updated HADOOP-451:
---------------------------------
Attachment: input-split.patch
This patch makes the relevant changes:
1. Introduces InputSplit
2. Changes InputFormat to return InputSplit[] from getSplits
3. Remove the FileSystem parameters to InputFormats since I was changing the interfaces anyway.
4. Add getProgress to RecordReaders to track progress.
5. Change the InputSplit areValidInputDirectories to validateInput.
6. Fixes javadoc warnings that have been introduced recently.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=all ]
Owen O'Malley updated HADOOP-451:
---------------------------------
Attachment: input-split-2.patch
Fixed the conflict in hadoop-defaults (with my other patch!). Oops.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split-2.patch, input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12458971 ]
Hadoop QA commented on HADOOP-451:
----------------------------------
-1, because the patch command could not apply the latest attachment (http://issues.apache.org/jira/secure/attachment/12347324/input-split.patch) as a patch to trunk revision r487696. Please note that this message is automatically generated and may represent a problem with the automation system and not the patch.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12437900 ]
Doug Cutting commented on HADOOP-451:
-------------------------------------
I like option 3 best -- add a RecordReader.getProgress() method, replacing its getPos() method with something abstract and file-independent.
I also wonder whether we then really need Split.getCost(). We could instead promise to process splits in the order they're generated, so jobs could still control the order if they liked.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12427953 ]
Doug Cutting commented on HADOOP-451:
-------------------------------------
> You will probably need to add a "setSplitClass" and "getSplitClass" to JobConf
The InputFormat is a Split factory, no? Who else would need to create Splits?
Splits are passed in RPCs, and the RPC mechanism supports polymorphism. Splits are not written to files, so I see no reason to declare a fixed class per job. Am I missing something?
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
> Fix For: 0.6.0
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12427652 ]
Bryan Pendleton commented on HADOOP-451:
----------------------------------------
You will probably need to add a "setSplitClass" and "getSplitClass" to JobConf to go along with this. Splits need to be Writables, but there's no automatic polymorphism/factory for Writables yet.
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
> Fix For: 0.6.0
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12437901 ]
Owen O'Malley commented on HADOOP-451:
--------------------------------------
+1
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HADOOP-451) Add a Split interface
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=all ]
Doug Cutting updated HADOOP-451:
--------------------------------
Status: Resolved (was: Patch Available)
Resolution: Fixed
I just committed this. Thanks, Owen!
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split-2.patch, input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=all ]
Owen O'Malley updated HADOOP-451:
---------------------------------
Status: Patch Available (was: Open)
Fix Version/s: 0.10.0
Affects Version/s: 0.9.2
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Affects Versions: 0.9.2
> Reporter: Doug Cutting
> Assigned To: Owen O'Malley
> Fix For: 0.10.0
>
> Attachments: input-split.patch
>
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HADOOP-451) Add a Split interface
Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HADOOP-451?page=comments#action_12437871 ]
Owen O'Malley commented on HADOOP-451:
--------------------------------------
There is a problem with this proposal in that the MapTask uses the FileSplit.getLength() as a count of the number of bytes in the split to compute progress. I see three reasonable alternatives:
1. Rename getCost() to getLength() and assume it is a number of bytes.
2. Add a getLength() method to Split that returns the number of bytes.
3. Add a new method to RecordReader "double getProgress();" that returns the progress within the record reader.
Option 1 has the lowest impact on existing application code, but I think option 3 is a better choice.
Thoughts?
> Add a Split interface
> ---------------------
>
> Key: HADOOP-451
> URL: http://issues.apache.org/jira/browse/HADOOP-451
> Project: Hadoop
> Issue Type: Improvement
> Components: mapred
> Reporter: Doug Cutting
>
> The InputFormat interface has a method:
> FileSplit[] getSplits();
> This should change to:
> Split[] getSplits();
> The Split interface would look like:
> public interface Split extends Writable {
> /** Returns a list of hosts that contain this split.
> This is only used to optimize task placement, so this may be empty. */
> String[] getLocations(FileSystem fs);
> /** The relative, estimated cost of operating on this. Typically the size of the data in the split.
> Used to prioritize tasks in a job (high-cost tasks are run first). */
> long getCost();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira