Skip to content

Commit

Permalink
Merge pull request #39 from hafen/master
Browse files Browse the repository at this point in the history
v0.75.2
  • Loading branch information
hafen committed Dec 12, 2015
2 parents ce313ed + 458b0e5 commit d3eed56
Show file tree
Hide file tree
Showing 12 changed files with 294 additions and 292 deletions.
8 changes: 3 additions & 5 deletions NEWS.md
@@ -1,6 +1,8 @@
Version 0.75.1.6
Version 0.75
----------------------------------------------------------------------

- fix for internal C methods conflicting with digest md5 (0.75.2)
- fix reduce issue when incrementally building lists of `reduce.values` (0.75.2)
- provide serialization for simple environments
- update so that output to non-standard file URIs like s3 work in `rhwatch()`
- update build script
Expand All @@ -15,10 +17,6 @@ Version 0.75.1.6
- update all deprecated hadoop api calls
- update PersonalServer `ls` to handle non-default Hadoop URIs differently
- add `_meta` to ignored RHIPE files

Version 0.75.1
----------------------------------------------------------------------

- fix build.xml to be more linux-friendly
- `rherrors` can read output of `rhwatch(..., read=FALSE)` to read the errors folder using the new dump frames options
- `rhJobInfo`, `rhstatus` and `rhwatch` correctly get the jobid (uses the Java MapReduce API)
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -7,7 +7,7 @@
Targets that begin with an '_' (e.g. _build-hadoop-1) are not designed to run as a standalone target
-->
<property name="rhipe.version" value="0.75.1.6"/>
<property name="rhipe.version" value="0.75.2"/>

<property name="maven.project.name" value="rhipe-java"/>
<property name="maven.dl.dir" value="conf/maven"/>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -4,10 +4,10 @@

<groupId>org.godhuli.rhipe</groupId>
<artifactId>rhipe-java</artifactId>
<version>0.75.1.6</version>
<version>0.75.2</version>
<packaging>jar</packaging>
<name>Rhipe</name>
<url>https://github.com/saptarshiguha/RHIPE</url>
<url>https://github.com/tesseradata/RHIPE</url>

<properties>
<!--<hadoop.version>2.3.0-cdh5.0.0</hadoop.version>-->
Expand Down
18 changes: 10 additions & 8 deletions src/main/C/md5.c
Expand Up @@ -37,6 +37,8 @@
<ghost@aladdin.com>. Other authors are noted in the change history
that follows (in reverse chronological order):
2015-11-17 amw Changed all functions called md5_* to md5_*_rh to prevent
conflicts with digest library functions of the same name in R.
2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
either statically or dynamically; added missing #include <string.h>
in library.
Expand Down Expand Up @@ -129,7 +131,7 @@


static void
md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
md5_process_rh(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
{
md5_word_t
a = pms->abcd[0], b = pms->abcd[1],
Expand Down Expand Up @@ -310,7 +312,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
}

void
md5_init(md5_state_t *pms)
md5_init_rh(md5_state_t *pms)
{
pms->count[0] = pms->count[1] = 0;
pms->abcd[0] = 0x67452301;
Expand All @@ -320,7 +322,7 @@ md5_init(md5_state_t *pms)
}

void
md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
md5_append_rh(md5_state_t *pms, const md5_byte_t *data, int nbytes)
{
const md5_byte_t *p = data;
int left = nbytes;
Expand All @@ -345,20 +347,20 @@ md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
return;
p += copy;
left -= copy;
md5_process(pms, pms->buf);
md5_process_rh(pms, pms->buf);
}

/* Process full blocks. */
for (; left >= 64; p += 64, left -= 64)
md5_process(pms, p);
md5_process_rh(pms, p);

/* Process a final partial block. */
if (left)
memcpy(pms->buf, p, left);
}

void
md5_finish(md5_state_t *pms, md5_byte_t digest[16])
md5_finish_rh(md5_state_t *pms, md5_byte_t digest[16])
{
static const md5_byte_t pad[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand All @@ -373,9 +375,9 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
for (i = 0; i < 8; ++i)
data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
/* Pad to 56 bytes mod 64. */
md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
md5_append_rh(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
/* Append the length. */
md5_append(pms, data, 8);
md5_append_rh(pms, data, 8);
for (i = 0; i < 16; ++i)
digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
}
8 changes: 5 additions & 3 deletions src/main/C/md5.h
Expand Up @@ -37,6 +37,8 @@
<ghost@aladdin.com>. Other authors are noted in the change history
that follows (in reverse chronological order):
2015-11-17 amw Changed all functions called md5_* to md5_*_rh to prevent
conflicts with digest library functions of the same name in R.
2002-04-13 lpd Removed support for non-ANSI compilers; removed
references to Ghostscript; clarified derivation from RFC 1321;
now handles byte order either statically or dynamically.
Expand Down Expand Up @@ -76,13 +78,13 @@ extern "C"
#endif

/* Initialize the algorithm. */
void md5_init(md5_state_t *pms);
void md5_init_rh(md5_state_t *pms);

/* Append a string to the message. */
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
void md5_append_rh(md5_state_t *pms, const md5_byte_t *data, int nbytes);

/* Finish the message and return the digest. */
void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
void md5_finish_rh(md5_state_t *pms, md5_byte_t digest[16]);

#ifdef __cplusplus
} /* end extern "C" */
Expand Down
2 changes: 1 addition & 1 deletion src/main/C/reducer.cc
Expand Up @@ -121,7 +121,7 @@ const int reducer_run(void){
if(redbuf_cnt == REDBUFFER){
// Case 1. The reduce.values has reached the critical length
// for evaluation
Rf_setVar(Rf_install("reduce.values"),vvector,R_GlobalEnv);
Rf_setVar(Rf_install("reduce.values"),Rf_duplicate(vvector),R_GlobalEnv);
WRAP_R_EVAL(reduce,NULL, &Rerr);
redbuf_cnt=0;
bytes_read = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/main/C/rhooks.cc
Expand Up @@ -547,9 +547,9 @@ SEXP readSQFromPipe(SEXP jcmd, SEXP buf, SEXP verb) {
SEXP md5(SEXP aRaw,SEXP len){
md5_state_t state;
md5_byte_t digest[16];
md5_init(&state);
md5_append(&state, (const md5_byte_t *)RAW(aRaw), INTEGER(len)[0]);
md5_finish(&state, digest);
md5_init_rh(&state);
md5_append_rh(&state, (const md5_byte_t *)RAW(aRaw), INTEGER(len)[0]);
md5_finish_rh(&state, digest);
char hex_output[16*2 + 1];
for (int di = 0; di < 16; ++di)
sprintf(hex_output + di * 2, "%02x", digest[di]);
Expand Down

0 comments on commit d3eed56

Please sign in to comment.