I am a Delphi programmer, and when I saw the use of a Parchive, I wanted to understand it. So I set out to develope a client using Delphi. I have been able to create recovery volumes, but don't quite understand how to implent the recovery for more them one file missing. Any help would be appreciated.
Thanks,
mbillig02@comcast.net
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you have written the code to create a recovery volume, then you presumably know that the algorithm uses linear equations.
If you have 10 data files and are creating 2 recovery volumes, then you have two simultaneous linear equations with 10 known values and 2 unkown values.
If you have the resulting 2 recovery volumes and are missing 2 out of the 10 data files, then you again have two simultaneous linear equations with 10 known values and 2 unknown values. This time however the 2 unknowns are on the side of the equation where their values are multiplied by different coefficients. You should be able to use standard techniques to rearrange these equations to give formulas for the two unknowns. Once you can do that you can reconstruct the missing data files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to create two matrices in memory where each matrix has as many rows as the number of equations. One will have as many columns as the number of known values, and the other will have as many columns as the number of unknown values.
You can allocate each matrix as a single block of memory of size rows*cols, and reference each value using code such as "matrix[r+c*rows]" (where r is the row number and c the column number of the value you want). All arithmetic on values in the matrices must be galois arithmetic.
If there were originally three data files and you are missing the first and third, and had created three recovery volumes but only have the second and third of them, then you would create a pair of matrices containing the following values:
/ 2 1 0 \ / 1 3 \
\ 4 0 1 / \ 1 5 /
This corresponds the the two equations:
2.D2 + R2 = 1.D1 + 3.D3
4.D2 + R3 = 1.D1 + 5.D3
Which you should see is the original equations for computing R2 and R3 rearranged.
NB 5 = 3*3 in galois arithmetic.
You can then multiply or divide all the values in either row by a constant, and add or subtract any multiple of either row from the other. The objective is to change the right hand matrix from:
You can then use similar code that you used to create recovery volumes to reconstruct the data files except that you are reading from D2, R2, and R3, and writing to D1 and D3.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a Delphi programmer, and when I saw the use of a Parchive, I wanted to understand it. So I set out to develope a client using Delphi. I have been able to create recovery volumes, but don't quite understand how to implent the recovery for more them one file missing. Any help would be appreciated.
Thanks,
mbillig02@comcast.net
If you have written the code to create a recovery volume, then you presumably know that the algorithm uses linear equations.
If you have 10 data files and are creating 2 recovery volumes, then you have two simultaneous linear equations with 10 known values and 2 unkown values.
If you have the resulting 2 recovery volumes and are missing 2 out of the 10 data files, then you again have two simultaneous linear equations with 10 known values and 2 unknown values. This time however the 2 unknowns are on the side of the equation where their values are multiplied by different coefficients. You should be able to use standard techniques to rearrange these equations to give formulas for the two unknowns. Once you can do that you can reconstruct the missing data files.
Well, I understand the concept and algebra, but I don't know how to do it in code.
You need to create two matrices in memory where each matrix has as many rows as the number of equations. One will have as many columns as the number of known values, and the other will have as many columns as the number of unknown values.
You can allocate each matrix as a single block of memory of size rows*cols, and reference each value using code such as "matrix[r+c*rows]" (where r is the row number and c the column number of the value you want). All arithmetic on values in the matrices must be galois arithmetic.
If there were originally three data files and you are missing the first and third, and had created three recovery volumes but only have the second and third of them, then you would create a pair of matrices containing the following values:
/ 2 1 0 \ / 1 3 \
\ 4 0 1 / \ 1 5 /
This corresponds the the two equations:
2.D2 + R2 = 1.D1 + 3.D3
4.D2 + R3 = 1.D1 + 5.D3
Which you should see is the original equations for computing R2 and R3 rearranged.
NB 5 = 3*3 in galois arithmetic.
You can then multiply or divide all the values in either row by a constant, and add or subtract any multiple of either row from the other. The objective is to change the right hand matrix from:
/ 1 3 \ to / 1 0 \
\ 1 5 / \ 0 1 /
the result you will obtain is:
/ 1 143 142 \ / 1 0 \
\ 1 122 122 / \ 0 1 /
and this corresponds to the equations:
1.D2 + 143.R2 + 142.R3 = D1
1.D2 + 122.R2 + 122.R3 = D3
You can then use similar code that you used to create recovery volumes to reconstruct the data files except that you are reading from D2, R2, and R3, and writing to D1 and D3.
Thanks,
But I'm just a little thick. I am still trying to understand. Give me some time and I may have some more questions.