[jira] [Commented] (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2015-05-01 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14524623#comment-14524623
 ] 

Hadoop QA commented on HDFS-923:


\\
\\
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:red}-1{color} | patch |   0m  0s | The patch command could not apply 
the patch during dryrun. |
\\
\\
|| Subsystem || Report/Notes ||
| Patch URL | 
http://issues.apache.org/jira/secure/attachment/12440608/hdfs-923.patch |
| Optional Tests | javac unit |
| git revision | trunk / f1a152c |
| Console output | 
https://builds.apache.org/job/PreCommit-HDFS-Build/10538/console |


This message was automatically generated.

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: libhdfs
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Attachments: hdfs-923.patch


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2015-05-01 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14524662#comment-14524662
 ] 

Hadoop QA commented on HDFS-923:


\\
\\
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:red}-1{color} | patch |   0m  0s | The patch command could not apply 
the patch during dryrun. |
\\
\\
|| Subsystem || Report/Notes ||
| Patch URL | 
http://issues.apache.org/jira/secure/attachment/12440608/hdfs-923.patch |
| Optional Tests | javac unit |
| git revision | trunk / f1a152c |
| Console output | 
https://builds.apache.org/job/PreCommit-HDFS-Build/10552/console |


This message was automatically generated.

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: libhdfs
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Attachments: hdfs-923.patch


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2012-07-10 Thread Colin Patrick McCabe (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13410570#comment-13410570
 ] 

Colin Patrick McCabe commented on HDFS-923:
---

If the problem is that hdfs_read is wrong, shouldn't we just fix hdfs_read.c?

If the issue is that you think a readFully method would be a nice thing to 
have, why not file a JIRA with that description, and then implement (and 
document) hdfsReadFully?

In any case, we should not change the original hdfsRead method.

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: libhdfs
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Attachments: hdfs-923.patch


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2011-02-19 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12996837#comment-12996837
 ] 

Hadoop QA commented on HDFS-923:


-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12440608/hdfs-923.patch
  against trunk revision 1072023.

+1 @author.  The patch does not contain any @author tags.

-1 tests included.  The patch doesn't appear to include any new or modified 
tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

-1 patch.  The patch command could not apply the patch.

Console output: 
https://hudson.apache.org/hudson/job/PreCommit-HDFS-Build/201//console

This message is automatically generated.

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: contrib/libhdfs
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Attachments: hdfs-923.patch


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2010-04-02 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12852798#action_12852798
 ] 

Hadoop QA commented on HDFS-923:


-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12440608/hdfs-923.patch
  against trunk revision 929406.

+1 @author.  The patch does not contain any @author tags.

-1 tests included.  The patch doesn't appear to include any new or modified 
tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

+1 core tests.  The patch passed core unit tests.

-1 contrib tests.  The patch failed contrib unit tests.

Test results: 
http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/144/testReport/
Findbugs warnings: 
http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/144/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: 
http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/144/artifact/trunk/build/test/checkstyle-errors.html
Console output: 
http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/144/console

This message is automatically generated.

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: contrib/libhdfs
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Fix For: 0.21.0

 Attachments: hdfs-923.patch


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2010-01-27 Thread Ruyue Ma (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12805809#action_12805809
 ] 

Ruyue Ma commented on HDFS-923:
---

The latest modification of hdfsRead api impl:

{noformat}

tSize hdfsRead(hdfsFS fs, hdfsFile f, void* buffer, tSize length)
{
// JAVA EQUIVALENT:
//  byte [] bR = new byte[length];
//  fis.read(bR);

//Get the JNIEnv* corresponding to current thread
JNIEnv* env = getJNIEnv();
if (env == NULL) {
  errno = EINTERNAL;
  return -1;
}

//Parameters
jobject jInputStream = (jobject)(f ? f-file : NULL);

jbyteArray jbRarray;
jint noReadBytes = 0;
jvalue jVal;
jthrowable jExc = NULL;

int hasReadBytes = 0;

//Sanity check
if (!f || f-type == UNINITIALIZED) {
errno = EBADF;
return -1;
}

//Error checking... make sure that this file is 'readable'
if (f-type != INPUT) {
fprintf(stderr, Cannot read from a non-InputStream object!\n);
errno = EINVAL;
return -1;
}

 
/
//  OUR MODIFICATION
int exception = 0;
jbRarray = (*env)-NewByteArray(env, length);
while (hasReadBytes  length) {
if (invokeMethod(env, jVal, jExc, INSTANCE, jInputStream, 
HADOOP_ISTRM,
 read, JMETHOD3([B, I, I, I) , jbRarray, 
hasReadBytes, length-hasReadBytes) != 0) {
errno = errnoFromException(jExc, env, org.apache.hadoop.fs.
   FSDataInputStream::read);
exception = 1;
break;
}
else {
noReadBytes = jVal.i;
if (noReadBytes = 0) {
(*env)-GetByteArrayRegion(env, jbRarray, 0, noReadBytes, 
buffer+hasReadBytes);
hasReadBytes += noReadBytes;
}  else {
//This is a valid case: there aren't any bytes left to read!
break;
}
errno = 0;
}



///

}

destroyLocalReference(env, jbRarray);
if (exception == 1) return -1;
return hasReadBytes;
 //  OUR MODIFICATION
}
{noformat}

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: contrib/libhdfs
Affects Versions: 0.20.1
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Fix For: 0.21.0


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2010-01-26 Thread Ruyue Ma (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12804975#action_12804975
 ] 

Ruyue Ma commented on HDFS-923:
---

Our modification for hdfs.c is: 

{noformat}

tSize hdfsRead(hdfsFS fs, hdfsFile f, void* buffer, tSize length)
{
// JAVA EQUIVALENT:
//  byte [] bR = new byte[length];
//  fis.read(bR);

//Get the JNIEnv* corresponding to current thread
JNIEnv* env = getJNIEnv();
if (env == NULL) {
  errno = EINTERNAL;
  return -1;
}

//Parameters
jobject jInputStream = (jobject)(f ? f-file : NULL);

jbyteArray jbRarray;
jint noReadBytes = 0;
jvalue jVal;
jthrowable jExc = NULL;

int hasReadBytes = 0;

//Sanity check
if (!f || f-type == UNINITIALIZED) {
errno = EBADF;
return -1;
}

//Error checking... make sure that this file is 'readable'
if (f-type != INPUT) {
fprintf(stderr, Cannot read from a non-InputStream object!\n);
errno = EINVAL;
return -1;
}

 
/
//  OUR MODIFICATION
jbRarray = (*env)-NewByteArray(env, length);
while (hasReadBytes  length) {
if (invokeMethod(env, jVal, jExc, INSTANCE, jInputStream, 
HADOOP_ISTRM,
 read, JMETHOD3([B, I, I, I) , jbRarray, 
hasReadBytes, length-hasReadBytes) != 0) {
errno = errnoFromException(jExc, env, org.apache.hadoop.fs.
   FSDataInputStream::read);
noReadBytes = -1;
}
else {
noReadBytes = jVal.i;
if (noReadBytes = 0) {
(*env)-GetByteArrayRegion(env, jbRarray, 0, noReadBytes, 
buffer+hasReadBytes);
hasReadBytes += noReadBytes;
}  else {
//This is a valid case: there aren't any bytes left to read!
break;
}
errno = 0;
}

 //  OUR MODIFICATION

///

}

destroyLocalReference(env, jbRarray);
return hasReadBytes;
}


{noformat}

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: contrib/libhdfs
Affects Versions: 0.20.1
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Fix For: 0.21.0


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (HDFS-923) libhdfs hdfs_read example uses hdfsRead wrongly

2010-01-26 Thread Ruyue Ma (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12805333#action_12805333
 ] 

Ruyue Ma commented on HDFS-923:
---

Firstly, to resolve this problem, we should make sure whether the current 
hdfsRead api is good (correctly).

I support the following:

If the returned length of hdfsRead is not equal to buffer length, we could make 
sure that the file is EOF.

Maybe, we can provide another api: hdfsReadFully().


your suggestions?

 libhdfs hdfs_read example uses hdfsRead wrongly
 ---

 Key: HDFS-923
 URL: https://issues.apache.org/jira/browse/HDFS-923
 Project: Hadoop HDFS
  Issue Type: Bug
  Components: contrib/libhdfs
Affects Versions: 0.20.1
Reporter: Ruyue Ma
Assignee: Ruyue Ma
 Fix For: 0.21.0


 In the examples of libhdfs,  the hdfs_read.c uses hdfsRead wrongly. 
 {noformat}
 // read from the file
 tSize curSize = bufferSize;
 for (; curSize == bufferSize;) {
 curSize = hdfsRead(fs, readFile, (void*)buffer, curSize);
 }
 {noformat} 
 the condition curSize == bufferSize has problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.