Tuesday, August 1, 2017

Today we continue the discussion on Snowflake architecture.The engine for Snowflake is columnar, vectorized and push-based. The columnar storage is suitable for analytical workloads because it makes more effective use of CPU caches and SIMD instructions. Vectorized execution means data is processed in a pipelined fashion without intermediary results as in map-reduce. The Push-based execution means that the relational operators push their results to their downstream operators, rather than waiting for these operators to pull data.  It removes control flow from tight loops.Data is encrypted in transit and before being written to storage. Key management is supported with key hierarchy so that the keys can be rotated and re-encrypted. Encryption and key management together complete the security. By using a hierarchy , we reduce the scope of the keys and the data to be secured.
#algorithm revisit
Show KMP matching algorithm
KMP-Matcher(T, P)
n = T.Length
m = P.Length
PI = Compute_prefix_function(P)
q = 0
for i = 1 to n
    while q > 0 and P[ q + 1 ] != T[i]
               q = PI[q]
    If P[q + 1] == T [i]
           q = q + 1
    If q == m
            print pattern occurs with shift i - m
            q = PI[q]


Compute_prefix_function(P)
m = P.Length
PI = new array [1 .. m]
PI[1] = 0
k = 0
for q = 2 to m
    while k > 0 and P[ k + 1 ] != P[q]
               k = PI[k]
    If P[k + 1] == P[q]
           k = k + 1
    PI[q] = k
return PI

No comments:

Post a Comment