mardel edmonson leonelle

0 views
Skip to first unread message

Domenec Reynolds

unread,
Aug 2, 2024, 10:53:08 AM8/2/24
to marnatsmagrio

I am playing with the Netflix API. I am confused on what they want as the 'UserID'. (for a protected query)I am sending in this string (after authentication) to get the User's queue: -public.netflix.com/users/'userID'/queues

Maybe I am not even approaching it from the right angle. Any documentation or code I have found glosses over that part (My netflix ID doesn't work and I assume it should be part of the oauth token I get back, not my normal netflix ID)

I'm about to cancel my Netflix account and I'd like to be able to keep the list of movies in my queue. Is there an easy way to export the list in plain text so I don't have to resort to printing it out?

After failing at the above suggestions several times, I just opened my Netflix RSS, went to File/Save As. it defaulted to .xml and saved it to the desktop. Then I opened it up in Excel. Got a lovely little spreadsheet that was ready to edit, sort, and delete unneeded columns. The entire 375 item queue was available in seconds.

I opened Internet Explorer 9, logged into Netflix, went to my queue, and right clicked the page. There was an option to "Export to Microsoft Excel" which when clicked opens Excel. Copy the address of the Netflix queue you would like to save, paste in Excel "address" bar, and click "Go."Go ahead and click "Import" and wait for Excel to import the data. Once finished, click "OK" on the Import Data window to import into the existing sheet, then delete any unnecessary rows and columns.

Because of the missing rss feature I also had to make use of jQuery. The following snippets run on the "My Activity" page return 3 newline separated lists which can be easily copied into a spreadsheet document. Nothing else than a browser with a javascript console should be needed.

For development / debugging, it can be helpful to send a slice of production traffic to your laptop to dig into end-to-end behaviors. Our product, Spinnaker, consists of many services and a huge variety of usages by users. Running everything locally to exercise an end-to-end use cases is not often possible without melting a laptop. Instead, being able to run a single service and route production traffic can make things pretty easy.

Thankfully, task queues in Temporal are cheap to make. If this were not the case, a feature like traffic routing would be harder or impossible to implement at scale. In our particular use cases, these route task queues are typically somewhat short-lived.

The Netflix Temporal SDK has an activity interface called TaskQueueNamer which forms the basis of this feature. Different implementations are wired up into Spring Boot based on context. We use this TaskQueueNamer everywhere that task queue names are specified. In most cases and by default behavior, a provided name input will result in an equal output.

A non-traffic routing use case for this is our LaptopTaskQueueNamer, which renames all task queues when running an application locally so that operations running on your laptop do not interfere with applications running in the test environment (all laptops connect by default to our test Temporal clusters, rather than running it locally).

Adding this Fast Property will then rename all invocations of clouddriver-cloud-operations to h...@example.com/clouddriver-cloud-operations, which is our naming convention for laptop task queues, but only when the X-SPINNAKER-USER MDC value matches someon...@example.com. We use a ContextPropagator in the Temporal SDK to pass this information into Workflow & Activity executions.

There are two TaskQueueNamer implementations for traffic routing: RoutingLaptopTaskQueueNamer and RoutingTaskQueueNamer. The first is only wired up when spring.profiles.active includes laptop, which is automatically set when running an application on your laptop. The other is the default TaskQueueNamer that is wired up in a deployed application. Both implementations pull configuration from a TrafficRouteRepository, which stores a bunch of TrafficRouteProperty objects.

This should look similar to the shape of the YAML from above: We deserialize the YAML onto this. Each property must have a strategy defined, which informs the TaskQueueNamers on how to rename the task queue. We ship with two built-in strategies: value and laptop, but an application owner could provide their own strategy if they were motivated. The config field is open-ended and used to configure the strategy. For laptop, we just need user so we know how to rename the queue following the laptop task queue naming convention:

The RoutingTaskQueueNamer (which is used in deployed applications) then uses the repository of TrafficRouteProperty objects, finding the configured strategy and attempts to find a property that matches:

@RobZienert great write-up. Longer-term I see us implementing a similar routing system natively by the service. This post could be used as an inspiration. I filed a feature request to get this tracked.

One curiosity I have with interceptors - since the logic is performed within the Workflow thread context, would resolving the task queue name still be done through an activity? I would presume so, but just verifying.

Changing a task queue name (as well as any of the ActivityOptions) is a backward-compatible change. So there is no need to use activity to look those up in an interceptor. The only caveat is that the resolver should be relatively fast to not block the workflow thread for long which is going to trip the deadlock detector.

But in Netflix's case, the idea to use "queue" didn't come from media or the Internet. Evers told me it was the brainchild of Neil Hunt, the company's chief product officer. His country of origin? England.

Netflix recently published how it built Timestone, a custom high-throughput, low-latency priority queueing system. Netflix built the queuing system using open-source components such as Redis, Apache Kafka, Apache Flink and Elasticsearch. Engineers state that they built Timestone since they could not find an off-the-shelf solution that met all of its requirements.

One of these requirements is the ability to mark some work items as non-parallelizable without requiring any locking or coordination on the consumer side. This requirement means that Timestone should not release some messages for processing until previous items belonging to the same work set are completed first. Timestone introduces the concept of "Exclusive Queues" to support this notion.

Another requirement is that a message can only be assigned to one worker at any given time. It is important since work that tends to happen in Cosmos is resource-intensive and can fan out to thousands of actions, and one of the goals was to reduce resource waste. This requirement rules out eventually consistent solutions and means that Netflix engineers want linearizable consistency at the queue level.

Netflix engineers achieved this requirement by maintaining a message state per message. When a producer enqueues a message, the message is set to the "Pending" or "Invisible" state, depending on the message's optional invisibility timeout. When a consumer dequeues a pending message, it acquires an exclusive lease on that message, and Timestone sets the message in the "Running" state. At this stage, the producer can mark the message as "Completed" or "Canceled". Each message can be dequeued up to a finite number of attempts, after which Timestone moves it to the "Errored" state. The following diagram illustrates all possible state transitions.

The Timestone server exposes a gRPC-based interface. All API operations are queue-scoped. All API operations that modify the state are idempotent. The system of record is a durable Redis cluster. Redis persists each write request to a transaction log before it sends a response back to the server. Inside Redis, a sorted set sorted by priority represents each queue. Messages and queue configurations are stored as hashes.

Almost all of the interactions between Timestone and Redis [...] are codified as Lua scripts. In most of these Lua scripts, we tend to update a number of data structures. Since Redis guarantees that each script is executed atomically, a successful script execution is guaranteed to leave the system in a consistent (in the ACID sense) state.

Timestone captures information about incoming messages and their transition between states in two secondary indexes maintained in Elasticsearch for observability purposes. When the Timtstone server gets a write response from Redis, it converts it into an event sent to a Kafka cluster. Two Flink jobs, one for each type of index Timestone maintains, consume the events from the corresponding Kafka topics and update the indexes in Elasticsearch.

Netflix built Timestone to support the needs of its media encoding platform, Cosmos. Timestone also backs Conductor, Netflix's general-purpose workflow orchestration engine, and it acts as the scheduler for large-scale data pipelines.

Hope someone can help! There is a movie in my Save List, specifically Glass Onion, which is a Netflix movie. I want to delete that movie from my list, and there is no option to do so. I do understand that Netflix doesn't work with the Save List, which is the problem - the movie must have been in the My Feed queue before it changed over to Save List, and now it's stuck there. Just as you can't add a Netflix movie to your save list, you also, apparently, cannot delete a Netflix movie from the list.

I want to be very clear, before a rep responds, that I absolutely already know how to add and delete movies from my Save List the standard ways, and I do it all the time. However, the option to remove this particular item is just not there. But there must be some kind of recourse or workaround so it doesn't just remain stuck there forever.

So, any words of advice from the community? Anyone else had this issue and resolved it? If a rep can help, that would be great! (I also can't figure out how to contact Roku directly anymore, as used to be available.)

90f70e40cf
Reply all
Reply to author
Forward
0 new messages